зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
d4d18ac1bb
Коммит
1a9ddd4d3d
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Загрузка…
Ссылка в новой задаче