Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/ui.js

Issue 6719238685327360: Issue 384 - Wrong image shows up briefly for Adblock Plus icon (Closed)
Patch Set: Created May 23, 2014, 11:05 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/appSupport.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/ui.js
===================================================================
--- a/lib/ui.js
+++ b/lib/ui.js
@@ -407,30 +407,32 @@ let UI = exports.UI =
{
({CustomizableUI}) = Cu.import("resource:///modules/CustomizableUI.jsm", null);
}
catch (e)
{
// No built-in CustomizableUI API, use our own implementation.
({CustomizableUI}) = require("customizableUI");
}
-
+
CustomizableUI.createWidget({
id: "abp-toolbarbutton",
type: "custom",
positionAttribute: "abp-iconposition", // For emulation only
defaultArea: defaultToolbarPosition.parent,
defaultBefore: defaultToolbarPosition.before, // For emulation only
defaultAfter: defaultToolbarPosition.after, // For emulation only
removable: true,
onBuild: function(document)
{
let node = document.importNode(this.overlay["abp-toolbarbutton"], true);
node.addEventListener("click", this.onIconClick, false);
node.addEventListener("command", this.onIconClick, false);
+ if ("addClass" in defaultToolbarPosition)
+ node.classList.add(defaultToolbarPosition.addClass);
this.updateIconState(document.defaultView, node);
return node;
}.bind(this),
onAdded: function(node)
{
// For emulation only, this callback isn't part of the official
// CustomizableUI API.
this.updateIconState(node.ownerDocument.defaultView, node);
« no previous file with comments | « lib/appSupport.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld