From 25d5166eb61ca11d78343b8e9e24a4eb6524dc78 Mon Sep 17 00:00:00 2001 From: Deathamns Date: Sun, 8 Mar 2015 07:36:30 +0100 Subject: [PATCH] Firefox: change badge color in onWidgetUnderflow --- platform/firefox/vapi-background.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 4b3ed7f54..8940be2b2 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -1455,7 +1455,7 @@ vAPI.toolbarButton.init = function() { } else { this.CUIEvents = {}; - this.CUIEvents.onCustomizeEnd = function() { + var updateBadge = function() { var wId = vAPI.toolbarButton.id; var buttonInPanel = CustomizableUI.getWidget(wId).areaType === CustomizableUI.TYPE_MENU_PANEL; @@ -1476,9 +1476,12 @@ vAPI.toolbarButton.init = function() { } // Anonymous elements need some time to be reachable - setTimeout(this.updateBadgeStyle, 250); + setTimeout(this.updateBadgeStyle, 50); }.bind(this.CUIEvents); + this.CUIEvents.onCustomizeEnd = updateBadge; + this.CUIEvents.onWidgetUnderflow = updateBadge; + this.CUIEvents.updateBadgeStyle = function() { var css = [ 'background: #666', @@ -1505,7 +1508,7 @@ vAPI.toolbarButton.init = function() { this.onCreated = function(button) { button.setAttribute('badge', ''); - setTimeout(this.CUIEvents.onCustomizeEnd, 250); + setTimeout(this.CUIEvents.onCustomizeEnd, 50); }; CustomizableUI.addListener(this.CUIEvents);