aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgorhill <rhill@raymondhill.net>2015-01-01 07:29:28 -0500
committergorhill <rhill@raymondhill.net>2015-01-01 07:29:28 -0500
commit619b89e6a66e07ef9f68bc06bb1acb4f28c5f55b (patch)
tree679611d6c35fcef102acf70632e80857c8d060c1 /src
parentc252bc8ff4bbfded9b3f0e236d1deb7afef55b2c (diff)
downloaduBlock-619b89e6a66e07ef9f68bc06bb1acb4f28c5f55b.zip
uBlock-619b89e6a66e07ef9f68bc06bb1acb4f28c5f55b.tar.gz
uBlock-619b89e6a66e07ef9f68bc06bb1acb4f28c5f55b.tar.bz2
avoid dom changes if possible
Diffstat (limited to 'src')
-rw-r--r--src/js/popup.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/js/popup.js b/src/js/popup.js
index 0504196..91dab68 100644
--- a/src/js/popup.js
+++ b/src/js/popup.js
@@ -173,8 +173,13 @@ var syncDynamicFilterCell = function(scope, des, type, result) {
return;
}
var hnDetails = stats.hostnameDict[des];
- var aCount = Math.min(Math.ceil(Math.log10(hnDetails.allowCount + 1)), 3);
- var bCount = Math.min(Math.ceil(Math.log10(hnDetails.blockCount + 1)), 3);
+ var aCount = hnDetails.allowCount;
+ var bCount = hnDetails.blockCount;
+ if ( aCount === 0 && bCount === 0 ) {
+ return;
+ }
+ aCount = Math.min(Math.ceil(Math.log10(aCount + 1)), 3);
+ bCount = Math.min(Math.ceil(Math.log10(bCount + 1)), 3);
// IMPORTANT: It is completely assumed the first node is a TEXT_NODE, so
// ensure this in the HTML file counterpart when you make
// changes
@@ -279,7 +284,9 @@ var renderPopup = function(details) {
);
}
- syncAllDynamicFilters();
+ //if ( stats.dynamicFilteringEnabled ) {
+ syncAllDynamicFilters();
+ //}
uDom('#total-blocked').html(html.join(''));
uDom('#switch .fa').toggleClass('off', stats.pageURL === '' || !stats.netFilteringSwitch);