Make the vertical separator next to the "Home" button not show up when

there are no buttons there.  Bug 80494, patch by Fabian
<hidday@geocities.com>, r=hwaara, sr=ben
This commit is contained in:
bzbarsky%mit.edu 2006-09-14 05:59:35 +00:00
Родитель d4d18ac1bb
Коммит 1a9ddd4d3d
2 изменённых файлов: 22 добавлений и 1 удалений

Просмотреть файл

@ -215,9 +215,30 @@ nsButtonPrefListener.prototype =
button.setAttribute("hidden","false"); button.setAttribute("hidden","false");
else else
button.setAttribute("hidden", "true"); button.setAttribute("hidden", "true");
// If all the buttons before the separator are hidden, also hide the
// separator
if(allLeftButtonsAreHidden())
document.getElementById("home-bm-separator").setAttribute("hidden", "true");
else
document.getElementById("home-bm-separator").removeAttribute("hidden");
} }
} }
// Function allLeftButtonsAreHidden
// Returns true if all the buttons left of the separator in the personal
// toolbar are hidden, false otherwise.
// Used by nsButtonPrefListener to hide the separator if needed
function allLeftButtonsAreHidden() {
var buttonNode = document.getElementById("PersonalToolbar").firstChild;
while(buttonNode.tagName != "toolbarseparator") {
if(!buttonNode.hasAttribute("hidden") || buttonNode.getAttribute("hidden") == "false")
return false;
buttonNode = buttonNode.nextSibling;
}
return true;
}
function Startup() function Startup()
{ {
// init globals // init globals

Просмотреть файл

@ -217,7 +217,7 @@ Contributor(s): ______________________________________. -->
ondragexit="nsDragAndDrop.dragExit(event, homeButtonObserver);" ondragexit="nsDragAndDrop.dragExit(event, homeButtonObserver);"
oncommand="BrowserHome(); event.preventBubble();"/> oncommand="BrowserHome(); event.preventBubble();"/>
<toolbarseparator/> <toolbarseparator id="home-bm-separator" persist="hidden"/>
<!-- "Bookmarks" button on personal toolbar --> <!-- "Bookmarks" button on personal toolbar -->
<menubutton class="button-toolbar bookmark-item" id="bookmarks-button" <menubutton class="button-toolbar bookmark-item" id="bookmarks-button"