From 040812d813bb2e8cb867a95370b04eed49bcefa3 Mon Sep 17 00:00:00 2001 From: gorhill Date: Thu, 30 Nov 2017 09:31:14 -0500 Subject: [PATCH] code review of 28d2f0b66e2b --- src/js/popup.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/js/popup.js b/src/js/popup.js index a6faab5..27969e1 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -386,7 +386,7 @@ function toggleCollapseState(elem) { function toggleMainCollapseState(uelem) { var matHead = uelem.ancestors('#matHead.collapsible').toggleClass('collapsed'); - var collapsed = matHead.hasClass('collapsed'); + var collapsed = matrixSnapshot.collapseAllDomains = matHead.hasClass('collapsed'); uDom('#matList .matSection.collapsible').toggleClass('collapsed', collapsed); setUserSetting('popupCollapseAllDomains', collapsed); @@ -1514,11 +1514,13 @@ uDom('.extensionURL').on('click', gotoExtensionURL); uDom('body').on('click', '.dropdown-menu-button', dropDownMenuShow); uDom('body').on('click', '.dropdown-menu-capture', dropDownMenuHide); -uDom('#matList').on('click', '.g4Meta', function() { - var collapsed = uDom(this) - .toggleClass('g4Collapsed') - .hasClass('g4Collapsed'); - setUserSetting('popupCollapseBlacklistedDomains', collapsed); +uDom('#matList').on('click', '.g4Meta', function(ev) { + matrixSnapshot.collapseBlacklistedDomains = + ev.target.classList.toggle('g4Collapsed'); + setUserSetting( + 'popupCollapseBlacklistedDomains', + matrixSnapshot.collapseBlacklistedDomains + ); }); /******************************************************************************/