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); |