From ff2746f276c47c0be48e0d1bf309a4266a900308 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 7 Feb 2015 15:39:46 -0500 Subject: [PATCH] code review of last commit --- src/js/popup.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/popup.js b/src/js/popup.js index d72ff6aee..c97d7f6a5 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -196,14 +196,18 @@ var updateDynamicFilterCell = function(scope, des, type, rule) { } cell.toggleClass('ownRule', ownRule); + if ( scope !== '.' || des === '*' ) { + return; + } + // IMPORTANT: It is completely assumed the first node is a TEXT_NODE, so // ensure this in the HTML file counterpart when you make // changes var textNode = cell.nodeAt(0).firstChild; - // Since this may be a cell from a reused row, we need to clear text + // Remember this may be a cell from a reused row, we need to clear text // content if we can't compute request counts. - if ( scope !== '.' || des === '*' || popupData.hostnameDict.hasOwnProperty(des) === false ) { + if ( popupData.hostnameDict.hasOwnProperty(des) === false ) { textNode.nodeValue = ' '; return; }