issue 24: Global and website styles show up twice
This commit is contained in:
parent
1600c5235a
commit
03819cec0a
|
@ -82,7 +82,7 @@ function getStyles(options, callback) {
|
|||
}
|
||||
// now add in global ones
|
||||
getGlobalStyleIds(function(ids) {
|
||||
style_ids = style_ids.concat(ids);
|
||||
style_ids = uniqueArray(style_ids.concat(ids));
|
||||
loadStyles(style_ids, options.enabled, options.url, callback);
|
||||
});
|
||||
});
|
||||
|
@ -93,6 +93,12 @@ function getStyles(options, callback) {
|
|||
}, reportError);
|
||||
}
|
||||
|
||||
function uniqueArray(ar) {
|
||||
return ar.filter(function(s, i, a){
|
||||
return i === a.lastIndexOf(s);
|
||||
});
|
||||
}
|
||||
|
||||
function getCache(callback) {
|
||||
if (isBackground()) {
|
||||
callback(cachedStyles);
|
||||
|
|
Loading…
Reference in New Issue
Block a user