зеркало из https://github.com/mozilla/gecko-dev.git
Bug 499298 - menubar auto-hiding doesn't work when removing default items from the toolbar. r=neil
This commit is contained in:
Родитель
0858e6b05c
Коммит
55f1463d86
|
@ -307,7 +307,22 @@
|
|||
return newItem;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</method>
|
||||
|
||||
<method name="hasCustomInteractiveItems">
|
||||
<parameter name="aCurrentSet"/>
|
||||
<body><![CDATA[
|
||||
if (aCurrentSet == "__empty")
|
||||
return false;
|
||||
|
||||
var defaultOrNoninteractive = (this.getAttribute("defaultset") || "")
|
||||
.split(",")
|
||||
.concat(["separator", "spacer", "spring"]);
|
||||
return aCurrentSet.split(",").some(function (item) {
|
||||
return defaultOrNoninteractive.indexOf(item) == -1;
|
||||
});
|
||||
]]></body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
|
@ -366,26 +381,10 @@
|
|||
<method name="currentSetChanged">
|
||||
<parameter name="aCurrentSet"/>
|
||||
<body><![CDATA[
|
||||
var defaultSet = this.getAttribute("defaultset");
|
||||
if (!defaultSet || aCurrentSet == defaultSet) {
|
||||
if (this.hasCustomInteractiveItems(aCurrentSet))
|
||||
this.setAttribute("customized", "true");
|
||||
else
|
||||
this.removeAttribute("customized");
|
||||
return;
|
||||
}
|
||||
|
||||
function normalize(aSet) {
|
||||
return aSet.split(",").filter(function (element) {
|
||||
return element != "separator" &&
|
||||
element != "spacer" &&
|
||||
element != "spring" &&
|
||||
element != "__empty";
|
||||
}).sort().join(",");
|
||||
}
|
||||
if (normalize(aCurrentSet) == normalize(defaultSet)) {
|
||||
this.removeAttribute("customized");
|
||||
return;
|
||||
}
|
||||
|
||||
this.setAttribute("customized", "true");
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче