mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-29 11:00:11 +00:00
Fix #180 - Custom with multi attr failure
Fix #180 - Themes can have multiple attributes - but not in safe mode
This commit is contained in:
parent
a8ce90c51c
commit
dee3ab0494
@ -73,19 +73,17 @@ module['exports'] = function() {
|
||||
} else {
|
||||
if (typeof(theme[prop]) === 'string') {
|
||||
colors[prop] = colors[theme[prop]];
|
||||
addProperty(prop, function() {
|
||||
return colors[theme[prop]](this);
|
||||
});
|
||||
} else {
|
||||
var tmp = colors[theme[prop][0]];
|
||||
for (var t = 1; t < theme[prop].length; t++) {
|
||||
tmp = tmp[theme[prop][t]];
|
||||
}
|
||||
colors[prop] = tmp;
|
||||
}
|
||||
addProperty(prop, function() {
|
||||
var ret = this;
|
||||
for (var t = 0; t < theme[prop].length; t++) {
|
||||
ret = colors[theme[prop][t]](ret);
|
||||
}
|
||||
return ret;
|
||||
return colors[prop](this);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user