From d660604b8de7842ea7af6106c8d09249f7b7e905 Mon Sep 17 00:00:00 2001 From: Deathamns Date: Thu, 12 Mar 2015 20:38:21 +0100 Subject: [PATCH] Firefox: badge color fix --- platform/firefox/vapi-background.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 1adaf39a8..e7c342a84 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -1491,7 +1491,7 @@ vAPI.toolbarButton.init = function() { ); } else { this.CUIEvents = {}; - this.CUIEvents.updateBadge = function() { + var updateBadge = function() { var wId = vAPI.toolbarButton.id; var buttonInPanel = CustomizableUI.getWidget(wId).areaType === CustomizableUI.TYPE_MENU_PANEL; @@ -1513,9 +1513,9 @@ vAPI.toolbarButton.init = function() { // Anonymous elements need some time to be reachable setTimeout(this.updateBadgeStyle, 250); - }; - this.CUIEvents.onCustomizeEnd = this.CUIEvents.updateBadge; - this.CUIEvents.onWidgetUnderflow = this.CUIEvents.updateBadge; + }.bind(this.CUIEvents); + this.CUIEvents.onCustomizeEnd = updateBadge; + this.CUIEvents.onWidgetUnderflow = updateBadge; this.CUIEvents.updateBadgeStyle = function() { var css = [ @@ -1543,7 +1543,7 @@ vAPI.toolbarButton.init = function() { this.onCreated = function(button) { button.setAttribute('badge', ''); - setTimeout(this.CUIEvents.updateBadge, 250); + setTimeout(updateBadge, 250); }; CustomizableUI.addListener(this.CUIEvents);