mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Cherry pick css class differentiation for toolbar button state #1233
This commit is contained in:
parent
ed130afc6f
commit
62849f164d
@ -1855,11 +1855,16 @@ vAPI.toolbarButton.init = function() {
|
|||||||
|
|
||||||
this.defaultArea = CustomizableUI.AREA_NAVBAR;
|
this.defaultArea = CustomizableUI.AREA_NAVBAR;
|
||||||
this.styleURI = [
|
this.styleURI = [
|
||||||
'#' + this.id + ' {',
|
'#' + this.id + '.off {',
|
||||||
'list-style-image: url(',
|
'list-style-image: url(',
|
||||||
vAPI.getURL('img/browsericons/icon16-off.svg'),
|
vAPI.getURL('img/browsericons/icon16-off.svg'),
|
||||||
');',
|
');',
|
||||||
'}',
|
'}',
|
||||||
|
'#' + this.id + ' {',
|
||||||
|
'list-style-image: url(',
|
||||||
|
vAPI.getURL('img/browsericons/icon16.svg'),
|
||||||
|
');',
|
||||||
|
'}',
|
||||||
'#' + this.viewId + ', #' + this.viewId + ' > iframe {',
|
'#' + this.viewId + ', #' + this.viewId + ' > iframe {',
|
||||||
'width: 160px;',
|
'width: 160px;',
|
||||||
'height: 290px;',
|
'height: 290px;',
|
||||||
@ -2078,16 +2083,15 @@ vAPI.toolbarButton.updateState = function(win, tabId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var icon = this.tabs[tabId];
|
var icon = this.tabs[tabId];
|
||||||
|
|
||||||
button.setAttribute('badge', icon && icon.badge || '');
|
button.setAttribute('badge', icon && icon.badge || '');
|
||||||
|
|
||||||
if ( !icon || !icon.img ) {
|
if ( !icon || !icon.img ) {
|
||||||
icon = '';
|
button.classList.add('off');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
icon = 'url(' + vAPI.getURL('img/browsericons/icon16.svg') + ')';
|
button.classList.remove('off');
|
||||||
}
|
}
|
||||||
|
|
||||||
button.style.listStyleImage = icon;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user