Major optimizations. Added a function for extension state. Tooltip is now being change also.

This commit is contained in:
Mario Basic
2015-06-13 22:07:39 +02:00
parent 3331d187b6
commit b8ca450969
21 changed files with 1211 additions and 1010 deletions

View File

@@ -1,8 +1,12 @@
var config = require('../config');
/**
* It changes the extension icon color.
* Supported values are: 'red', 'white', 'gray' and ''.
*
* @param color
*/
export default function changeExtensionIcon(color = '') {
function changeExtensionIcon(color = '') {
var path = null;
@@ -18,9 +22,9 @@ export default function changeExtensionIcon(color = '') {
if (color === '') {
chrome.storage.sync.get({
theme: 'light'
theme: config.theme
}, function (items) {
if (items.theme == 'light') {
if (items.theme == config.theme) {
path = './graphics/wakatime-logo-38.png';
chrome.browserAction.setIcon({
@@ -38,3 +42,5 @@ export default function changeExtensionIcon(color = '') {
}
}
export default changeExtensionIcon;