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


git-svn-id: svn://10.0.0.236/trunk@210877 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu 2006-09-14 05:59:33 +00:00
parent 46dc34e734
commit 1566265b84
2 changed files with 22 additions and 1 deletions

View File

@ -215,9 +215,30 @@ nsButtonPrefListener.prototype =
button.setAttribute("hidden","false");
else
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()
{
// init globals

View File

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