Add 'last-panel' attribute to last visible sidebar header. Makes it easier to tweak the styles.

This commit is contained in:
slamm%netscape.com 2006-07-27 14:49:48 +00:00
parent 418904be3c
commit fffc5c955a

View File

@ -320,9 +320,10 @@ function update_panels() {
// be selected.
var panels = document.getElementById('sidebar-panels');
var selected_id = panels.getAttribute('last-selected-panel');
var have_set_top = 0
var have_set_after_selected = 0
var is_after_selected = 0
var have_set_top = 0;
var have_set_after_selected = 0;
var is_after_selected = 0;
var last_header = 0;
for (var ii=1; ii < panels.childNodes.length; ii += 2) {
var header = panels.childNodes.item(ii);
var content = panels.childNodes.item(ii+1);
@ -332,6 +333,8 @@ function update_panels() {
header.setAttribute('hidden','true');
content.setAttribute('hidden','true');
} else {
last_header = header;
header.removeAttribute('last-panel');
if (!have_set_top) {
header.setAttribute('top-panel','true');
have_set_top = 1
@ -367,6 +370,9 @@ function update_panels() {
}
}
}
if (last_header) {
last_header.setAttribute('last-panel','true');
}
}
// Change the sidebar content to the selected panel.