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-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 * Updates filter list when selected subscription changes. | 87 * Updates filter list when selected subscription changes. |
88 */ | 88 */ |
89 function updateSelectedSubscription() | 89 function updateSelectedSubscription() |
90 { | 90 { |
91 let panel = E("tabs").selectedPanel; | 91 let panel = E("tabs").selectedPanel; |
92 if (!panel) | 92 if (!panel) |
93 return; | 93 return; |
94 | 94 |
95 let list = panel.getElementsByTagName("richlistbox")[0]; | 95 let list = panel.getElementsByTagName("richlistbox")[0]; |
96 if (!list) | 96 if (!list) |
97 { | |
98 E("filtersContainer").hidden = true; | |
99 E("filtersSplitter").hidden = true; | |
100 return; | 97 return; |
101 } | |
102 | |
103 E("filtersContainer").hidden = false; | |
104 E("filtersSplitter").hidden = false; | |
105 | 98 |
106 let data = Templater.getDataForNode(list.selectedItem); | 99 let data = Templater.getDataForNode(list.selectedItem); |
107 FilterView.subscription = (data ? data.subscription : null); | 100 FilterView.subscription = (data ? data.subscription : null); |
108 FilterActions.updateCommands(); | 101 FilterActions.updateCommands(); |
109 } | 102 } |
110 | 103 |
111 /** | 104 /** |
112 * Template processing functions. | 105 * Template processing functions. |
113 * @class | 106 * @class |
114 */ | 107 */ |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 * data object. | 212 * data object. |
220 */ | 213 */ |
221 getNodeForData: function(/**Node*/ parent, /**String*/ property, /**Object*/ d
ata) /**Node*/ | 214 getNodeForData: function(/**Node*/ parent, /**String*/ property, /**Object*/ d
ata) /**Node*/ |
222 { | 215 { |
223 for (let child = parent.firstChild; child; child = child.nextSibling) | 216 for (let child = parent.firstChild; child; child = child.nextSibling) |
224 if ("_data" in child && property in child._data && child._data[property] =
= data) | 217 if ("_data" in child && property in child._data && child._data[property] =
= data) |
225 return child; | 218 return child; |
226 return null; | 219 return null; |
227 } | 220 } |
228 }; | 221 }; |
OLD | NEW |