mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 425079 - "Multiple back/forward buttons in toolbar" (don't create duplicate items, round two) [p=dao@mozilla.com (Dão Gottwald) r=gavin a=blocking-firefox3+]
This commit is contained in:
parent
ccfd227e98
commit
7bb7f19f8d
@ -179,12 +179,14 @@
|
||||
if (val && val != "__empty") {
|
||||
var itemIds = val.split(",");
|
||||
var before = true;
|
||||
this._trackInserted = {};
|
||||
for (var i = 0; i < itemIds.length; i++) {
|
||||
if (itemIds[i] == firstChildID || itemIds[i] == lastChildID)
|
||||
before = false;
|
||||
else
|
||||
this.insertItem(itemIds[i], null, null, before);
|
||||
}
|
||||
delete this._trackInserted;
|
||||
}
|
||||
|
||||
return val;
|
||||
@ -223,6 +225,12 @@
|
||||
newItem.id = "spacer" + uniqueId;
|
||||
newItem.className = "chromeclass-toolbar-additional";
|
||||
} else if (this.parentNode.localName == "toolbox") {
|
||||
if (this._trackInserted) {
|
||||
// Protect against creating an item with the given id more than once.
|
||||
if (aId in this._trackInserted)
|
||||
return false;
|
||||
this._trackInserted[aId] = null;
|
||||
}
|
||||
// Attempt to locate an item with a matching id within palette.
|
||||
var paletteItem = this.parentNode.palette.firstChild;
|
||||
while (paletteItem) {
|
||||
|
Loading…
Reference in New Issue
Block a user