[Pkg-mozext-commits] [adblock-plus] 04/22: issue 449 - override default context menu of icon only when left click action is redefined
David Prévot
taffit at moszumanska.debian.org
Thu Jun 5 14:01:08 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository adblock-plus.
commit 9d03f5ccfa370addd19a9c3c57700c6bf376982e
Author: Manvel Saroyan <manvel at adblockplus.org>
Date: Thu May 15 14:27:11 2014 +0400
issue 449 - override default context menu of icon only when left click action is redefined
---
chrome/content/ui/overlay.xul | 4 ++--
lib/ui.js | 17 +++++++++++++++--
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/chrome/content/ui/overlay.xul b/chrome/content/ui/overlay.xul
index c604428..9724859 100644
--- a/chrome/content/ui/overlay.xul
+++ b/chrome/content/ui/overlay.xul
@@ -98,10 +98,10 @@
</commandset>
<statusbarpanel id="abp-status" class="statusbarpanel-iconic"
- context="abp-status-popup" tooltip="abp-tooltip"/>
+ tooltip="abp-tooltip"/>
<toolbarbutton id="abp-toolbarbutton" class="toolbarbutton-1" label="&toolbarbutton.label;"
- tooltip="abp-tooltip" context="abp-status-popup"/>
+ tooltip="abp-tooltip"/>
<!-- Tools menu -->
<menu id="abp-menuitem" label="&toolbarbutton.label;"/>
diff --git a/lib/ui.js b/lib/ui.js
index 161402a..2262a80 100644
--- a/lib/ui.js
+++ b/lib/ui.js
@@ -1076,20 +1076,33 @@ let UI = exports.UI =
if (location && Policy.isWhitelisted(location.spec))
state = "whitelisted";
}
-
+
+ let popupId = "abp-status-popup";
if (icon.localName == "statusbarpanel")
{
if (Prefs.defaultstatusbaraction == 0)
- icon.setAttribute("popup", icon.getAttribute("context"));
+ {
+ icon.setAttribute("popup", popupId);
+ icon.removeAttribute("context");
+ }
else
+ {
icon.removeAttribute("popup");
+ icon.setAttribute("context", popupId);
+ }
}
else
{
if (Prefs.defaulttoolbaraction == 0)
+ {
icon.setAttribute("type", "menu");
+ icon.removeAttribute("context");
+ }
else
+ {
icon.setAttribute("type", "menu-button");
+ icon.setAttribute("context", popupId);
+ }
}
icon.setAttribute("abpstate", state);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git
More information about the Pkg-mozext-commits
mailing list