[Pkg-mozext-commits] [adblock-plus-element-hiding-helper] 12/28: Issue 4536 - Make sure the elements stay hidden after adding the filter

David Prévot taffit at moszumanska.debian.org
Fri Aug 4 21:15:15 UTC 2017


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus-element-hiding-helper.

commit fc78a8a0265afcaa7e683c56c60a1f0b7727ff99
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Mon Oct 17 11:58:26 2016 +0200

    Issue 4536 - Make sure the elements stay hidden after adding the filter
---
 chrome/content/composer.js  | 10 +++++++---
 chrome/content/composer.xul |  1 -
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/chrome/content/composer.js b/chrome/content/composer.js
index 37891da..2acfe55 100644
--- a/chrome/content/composer.js
+++ b/chrome/content/composer.js
@@ -12,8 +12,8 @@ let nodeID;
 let selectedNode = null;
 var advancedMode = false;
 let treeView = null;
+let ruleAdded = false;
 let stylesheetData;
-let previewStyle = null;
 
 let abpURL = Cc["@adblockplus.org/abp/public;1"].getService(Ci.nsIURI);
 Cu.import(abpURL.spec);
@@ -571,6 +571,10 @@ function updateNodeSelection() {
 function addExpression()
 {
   AdblockPlus.addPatterns([document.getElementById("expression").value]);
-
-  togglePreview(false);
+  ruleAdded = true;
 }
+
+window.addEventListener("unload", () =>
+{
+  togglePreview(ruleAdded, true);
+});
diff --git a/chrome/content/composer.xul b/chrome/content/composer.xul
index 548571f..6f0e96f 100644
--- a/chrome/content/composer.xul
+++ b/chrome/content/composer.xul
@@ -15,7 +15,6 @@
     onload="init();"
     ondialogaccept="addExpression();"
     ondialogdisclosure="setAdvancedMode(!advancedMode);"
-    onunload="togglePreview(false, true);"
     buttons="accept,cancel,disclosure"
     width="600px"
     height="400px"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus-element-hiding-helper.git



More information about the Pkg-mozext-commits mailing list