зеркало из https://github.com/mozilla/pjs.git
Bug 618277 - Make add-on bar spring removable. r=dietrich
This commit is contained in:
Родитель
7d014fe59c
Коммит
e7e568e6d8
|
@ -8077,8 +8077,17 @@ let AddonsMgrListener = {
|
|||
get statusBar() document.getElementById("status-bar"),
|
||||
getAddonBarItemCount: function() {
|
||||
// Take into account the contents of the status bar shim for the count.
|
||||
return this.addonBar.childNodes.length - 3 +
|
||||
this.statusBar.childNodes.length;
|
||||
var itemCount = this.statusBar.childNodes.length;
|
||||
|
||||
var defaultOrNoninteractive = this.addonBar.getAttribute("defaultset")
|
||||
.split(",")
|
||||
.concat(["separator", "spacer", "spring"]);
|
||||
this.addonBar.currentSet.split(",").forEach(function (item) {
|
||||
if (defaultOrNoninteractive.indexOf(item) == -1)
|
||||
itemCount++;
|
||||
});
|
||||
|
||||
return itemCount;
|
||||
},
|
||||
onInstalling: function(aAddon) {
|
||||
this.lastAddonBarCount = this.getAddonBarItemCount();
|
||||
|
|
|
@ -975,12 +975,11 @@
|
|||
context="toolbar-context-menu" toolboxid="navigator-toolbox"
|
||||
mode="icons" iconsize="small" defaulticonsize="small"
|
||||
lockiconsize="true"
|
||||
defaultset="addonbar-closebutton,addonbar-spring,status-bar"
|
||||
defaultset="addonbar-closebutton,spring,status-bar"
|
||||
customizable="true">
|
||||
<toolbarbutton id="addonbar-closebutton"
|
||||
tooltiptext="&addonBarCloseButton.tooltip;"
|
||||
oncommand="setToolbarVisibility(this.parentNode, false);"/>
|
||||
<hbox id="addonbar-spring" flex="1"/>
|
||||
<statusbar id="status-bar"/>
|
||||
</toolbar>
|
||||
</vbox>
|
||||
|
|
|
@ -11,16 +11,17 @@ function test() {
|
|||
let aml = AddonsMgrListener;
|
||||
ok(aml, "AddonsMgrListener exists");
|
||||
// check is hidden
|
||||
is(aml.addonBar.collapsed, true, "aob is hidden");
|
||||
is(aml.addonBar.collapsed, true, "add-on bar is hidden initially");
|
||||
// aob gets the count
|
||||
AddonsMgrListener.onInstalling();
|
||||
// add an item
|
||||
let element = document.createElement("toolbaritem");
|
||||
element.id = "bug598923-addon-item";
|
||||
aml.addonBar.appendChild(element);
|
||||
// aob checks the count, makes visible
|
||||
AddonsMgrListener.onInstalled();
|
||||
// check is visible
|
||||
is(aml.addonBar.collapsed, false, "aob is visible");
|
||||
is(aml.addonBar.collapsed, false, "add-on bar has been made visible");
|
||||
// aob gets the count
|
||||
AddonsMgrListener.onUninstalling();
|
||||
// remove an item
|
||||
|
@ -28,5 +29,5 @@ function test() {
|
|||
// aob checks the count, makes hidden
|
||||
AddonsMgrListener.onUninstalled();
|
||||
// check is hidden
|
||||
is(aml.addonBar.collapsed, true, "aob is hidden");
|
||||
is(aml.addonBar.collapsed, true, "add-on bar is hidden again");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче