mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-06-14 08:15:03 +12:00
Firefox: change badge color in onWidgetUnderflow
This commit is contained in:
parent
f5c675e8b8
commit
96454afb20
|
@ -1416,7 +1416,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;
|
||||
|
||||
|
@ -1437,9 +1437,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',
|
||||
|
@ -1466,7 +1469,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);
|
||||
|
|
Loading…
Reference in a new issue