Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/content/ui/composer.js

Issue 29329884: Issue 3224 - Unbreak filter assistant (Closed)
Patch Set: Rebased Created Nov. 12, 2015, 3:10 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/content/ui/sidebar.js » ('j') | lib/child/contentPolicy.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/composer.js
===================================================================
--- a/chrome/content/ui/composer.js
+++ b/chrome/content/ui/composer.js
@@ -10,23 +10,24 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-var nodes = null;
+var nodesID = null;
var item = null;
var advancedMode = false;
function init()
{
- [nodes, item] = window.arguments;
+ [nodesID, item] = window.arguments;
+ window.addEventListener("unload", () => Policy.deleteNodes(nodesID));
E("filterType").value = (!item.filter || item.filter.disabled || item.filter instanceof WhitelistFilter ? "filterlist" : "whitelist");
E("customPattern").value = item.location;
let insertionPoint = E("customPatternBox");
let addSuggestion = function(address)
{
// Always drop protocol and www. from the suggestion
@@ -336,18 +337,18 @@ function updateCustomPattern()
}
function addFilter() {
let filter = Filter.fromText(document.getElementById("filter").value);
filter.disabled = false;
FilterStorage.addFilter(filter);
- if (nodes)
- Policy.refilterNodes(nodes, item);
+ if (nodesID)
+ Policy.refilterNodes(nodesID, item);
return true;
}
function setAdvancedMode(mode) {
advancedMode = mode;
var dialog = document.documentElement;
« no previous file with comments | « no previous file | chrome/content/ui/sidebar.js » ('j') | lib/child/contentPolicy.js » ('J')

Powered by Google App Engine
This is Rietveld