From a57450e1a0c6f9d490d5e49a29b0e2ec4f371d0b Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Tue, 18 Sep 2018 15:21:00 -0400 Subject: [PATCH] fix https://github.com/uBlockOrigin/uBlock-issues/issues/228 --- src/js/popup.js | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/js/popup.js b/src/js/popup.js index 74f54ff8d..16badf437 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -423,14 +423,17 @@ var renderPopup = function() { } let elem = document.body; - elem.classList.toggle('advancedUser', popupData.advancedUserEnabled); + elem.classList.toggle( + 'advancedUser', + popupData.advancedUserEnabled === true + ); elem.classList.toggle( 'off', - popupData.pageURL === '' || !popupData.netFilteringSwitch + popupData.pageURL === '' || popupData.netFilteringSwitch !== true ); - let canElementPicker = popupData.canElementPicker && - popupData.netFilteringSwitch; + let canElementPicker = popupData.canElementPicker === true && + popupData.netFilteringSwitch === true; uDom.nodeFromId('gotoPick').classList.toggle('enabled', canElementPicker); uDom.nodeFromId('gotoZap').classList.toggle('enabled', canElementPicker); @@ -489,11 +492,20 @@ var renderPopup = function() { vAPI.localStorage.setItem('popupFirewallPane', dfPaneVisibleStored); } - uDom.nodeFromId('panes').classList.toggle('dfEnabled', dfPaneVisible); + uDom.nodeFromId('panes').classList.toggle( + 'dfEnabled', + dfPaneVisible === true + ); elem = uDom.nodeFromId('firewallContainer'); - elem.classList.toggle('minimized', popupData.firewallPaneMinimized); - elem.classList.toggle('colorBlind', popupData.colorBlindFriendly); + elem.classList.toggle( + 'minimized', + popupData.firewallPaneMinimized === true + ); + elem.classList.toggle( + 'colorBlind', + popupData.colorBlindFriendly === true + ); // Build dynamic filtering pane only if in use if ( dfPaneVisible ) {