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

Unified Diff: lib/elemHideExceptions.js

Issue 29784555: Issue 6665 - Abstract element hiding container logic into its own module Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created May 17, 2018, 5:15 a.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 | « lib/elemHideEmulation.js ('k') | test/filterListener.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/elemHideExceptions.js
===================================================================
--- a/lib/elemHideExceptions.js
+++ b/lib/elemHideExceptions.js
@@ -66,16 +66,18 @@
if (list)
list.push(exception);
else
exceptions.set(selector, [exception]);
knownExceptions.add(exception);
this.emit("added", exception);
+
+ FilterNotifier.emit("elemhideupdate");
},
/**
* Removes an element hiding exception
* @param {ElemHideException} exception
*/
remove(exception)
{
@@ -85,16 +87,18 @@
let list = exceptions.get(exception.selector);
let index = list.indexOf(exception);
if (index >= 0)
list.splice(index, 1);
knownExceptions.delete(exception);
this.emit("removed", exception);
+
+ FilterNotifier.emit("elemhideupdate");
},
/**
* Checks whether any exception rules are registered for a selector
* @param {string} selector
* @returns {boolean}
*/
hasExceptions(selector)
« no previous file with comments | « lib/elemHideEmulation.js ('k') | test/filterListener.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld