Left: | ||
Right: |
OLD | NEW |
---|---|
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 if (node) | 185 |
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.
| |
186 { | 188 { |
187 if (typeof widget.onAdded == "function") | 189 if (typeof widget.onAdded == "function") |
188 widget.onAdded(node) | 190 widget.onAdded(node) |
189 | 191 |
190 let toolbar = getToolbar(node); | 192 let toolbar = getToolbar(node); |
191 position = "visible," + toolbar.id + "," + (node.nextSibling ? node.nextSibl ing.id : ""); | 193 position = "visible," + toolbar.id + "," + (node.nextSibling ? node.nextSibl ing.id : ""); |
192 } | 194 } |
193 else | 195 else |
194 position = position.replace(/^visible,/, "hidden,") | 196 position = position.replace(/^visible,/, "hidden,") |
195 | 197 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
311 for (let [id, widget] of widgets) | 313 for (let [id, widget] of widgets) |
312 { | 314 { |
313 let toolbox = getToolbox(window, widget); | 315 let toolbox = getToolbox(window, widget); |
314 if (toolbox) | 316 if (toolbox) |
315 toolbox.removeEventListener("aftercustomization", onToolbarCustomization , false); | 317 toolbox.removeEventListener("aftercustomization", onToolbarCustomization , false); |
316 | 318 |
317 removeWidget(window, widget); | 319 removeWidget(window, widget); |
318 } | 320 } |
319 } | 321 } |
320 }); | 322 }); |
OLD | NEW |