Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 let toolbox = event.currentTarget; | 175 let toolbox = event.currentTarget; |
176 for (let [id, widget] of widgets) | 176 for (let [id, widget] of widgets) |
177 saveState(toolbox, widget); | 177 saveState(toolbox, widget); |
178 } | 178 } |
179 | 179 |
180 function saveState(/**Element*/ toolbox, /**Widget*/ widget) | 180 function saveState(/**Element*/ toolbox, /**Widget*/ widget) |
181 { | 181 { |
182 let node = toolbox.ownerDocument.getElementById(widget.id); | 182 let node = toolbox.ownerDocument.getElementById(widget.id); |
183 | 183 |
184 let position = toolbox.getAttribute(widget.positionAttribute) || "hidden,,"; | 184 let position = toolbox.getAttribute(widget.positionAttribute) || "hidden,,"; |
185 | 185 if (node && node.parentNode.localName != "toolbarpalette") |
186 // In SeaMonkey BrowserToolbarPalette is located in toolbox | |
187 if (node && node.parentNode.id != "BrowserToolbarPalette") | |
Wladimir Palant
2014/05/08 13:40:21
Please check |node.parentNode.localName == "toolba
saroyanm
2014/05/08 15:13:13
Good point.
| |
188 { | 186 { |
189 if (typeof widget.onAdded == "function") | 187 if (typeof widget.onAdded == "function") |
190 widget.onAdded(node) | 188 widget.onAdded(node) |
191 | 189 |
192 let toolbar = getToolbar(node); | 190 let toolbar = getToolbar(node); |
193 position = "visible," + toolbar.id + "," + (node.nextSibling ? node.nextSibl ing.id : ""); | 191 position = "visible," + toolbar.id + "," + (node.nextSibling ? node.nextSibl ing.id : ""); |
194 } | 192 } |
195 else | 193 else |
196 position = position.replace(/^visible,/, "hidden,") | 194 position = position.replace(/^visible,/, "hidden,") |
197 | 195 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
313 for (let [id, widget] of widgets) | 311 for (let [id, widget] of widgets) |
314 { | 312 { |
315 let toolbox = getToolbox(window, widget); | 313 let toolbox = getToolbox(window, widget); |
316 if (toolbox) | 314 if (toolbox) |
317 toolbox.removeEventListener("aftercustomization", onToolbarCustomization , false); | 315 toolbox.removeEventListener("aftercustomization", onToolbarCustomization , false); |
318 | 316 |
319 removeWidget(window, widget); | 317 removeWidget(window, widget); |
320 } | 318 } |
321 } | 319 } |
322 }); | 320 }); |
LEFT | RIGHT |