Skip to content

Loading…

Fix for #1233 #1239

Merged
merged 1 commit into from

2 participants

@AlexVallat
Collaborator

Fixes #1233
I don't see any reason not to make it easier for user styles to override icons, if they want to.

@chrisaljoudi

Hi @AlexVallet!

This looks good; thanks. I'm on mobile right now, so I haven't gotten the chance to test it out yet.

If it seems to work, feel free to merge if you feel that's appropriate.

@AlexVallat
Collaborator

Yep, it's a pretty trivial fix. The only reason I can think of not to merge it is if we didn't want the off state to be distinguishable through css selectors on principle - can't think of any good reason to want that, so I'll merge.

@AlexVallat AlexVallat merged commit 66c668a into chrisaljoudi:master

1 check passed

Details continuous-integration/travis-ci/pr The Travis CI build passed
@AlexVallat AlexVallat deleted the AlexVallat:Fix_1233 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 11, 2015
  1. @AlexVallat

    Fix for #1233

    AlexVallat committed
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 5 deletions.
  1. +9 −5 platform/firefox/vapi-background.js
View
14 platform/firefox/vapi-background.js
@@ -1471,11 +1471,16 @@ vAPI.toolbarButton.init = function() {
this.defaultArea = CustomizableUI.AREA_NAVBAR;
this.styleURI = [
- '#' + this.id + ' {',
+ '#' + this.id + '.off {',
'list-style-image: url(',
vAPI.getURL('img/browsericons/icon16-off.svg'),
');',
'}',
+ '#' + this.id + ' {',
+ 'list-style-image: url(',
+ vAPI.getURL('img/browsericons/icon16.svg'),
+ ');',
+ '}',
'#' + this.viewId + ', #' + this.viewId + ' > iframe {',
'width: 160px;',
'height: 290px;',
@@ -1679,16 +1684,15 @@ vAPI.toolbarButton.updateState = function(win, tabId) {
}
var icon = this.tabs[tabId];
+
button.setAttribute('badge', icon && icon.badge || '');
if ( !icon || !icon.img ) {
- icon = '';
+ button.classList.add('off');
}
else {
- icon = 'url(' + vAPI.getURL('img/browsericons/icon16.svg') + ')';
+ button.classList.remove('off');
}
-
- button.style.listStyleImage = icon;
};
/******************************************************************************/
Something went wrong with that request. Please try again.