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

Unified Diff: chrome/content/elemHideEmulation.js

Issue 29375888: [adblockpluscore] Issue 4911 - Merge ElemHideEmulation.load/apply into one function (Closed)
Patch Set: Removed unused callback parameter Created Feb. 18, 2017, 12:49 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/elemHideEmulation.js
diff --git a/chrome/content/elemHideEmulation.js b/chrome/content/elemHideEmulation.js
index 82912c51cfdff241d5cc886ee49c0422b082cb0c..b3bb449d44a9a60dc9e21703d11346e440e3dec1 100644
--- a/chrome/content/elemHideEmulation.js
+++ b/chrome/content/elemHideEmulation.js
@@ -121,7 +121,7 @@ ElemHideEmulation.prototype = {
this.addSelectors([stylesheet]);
},
- load: function(callback)
+ apply: function()
{
this.getFiltersFunc(function(patterns)
{
@@ -150,17 +150,12 @@ ElemHideEmulation.prototype = {
});
}
- callback();
+ if (this.patterns.length > 0)
+ {
+ var document = this.window.document;
+ this.addSelectors(document.styleSheets);
+ document.addEventListener("load", this.onLoad.bind(this), true);
+ }
}.bind(this));
- },
-
- apply: function()
- {
- if (this.patterns.length > 0)
- {
- var document = this.window.document;
- this.addSelectors(document.styleSheets);
- document.addEventListener("load", this.onLoad.bind(this), true);
- }
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld