mirror of
https://github.com/flynx/colors.js.git
synced 2025-11-01 04:20:12 +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,18 +73,16 @@ module['exports'] = function() {
|
|||||||
} else {
|
} else {
|
||||||
if (typeof(theme[prop]) === 'string') {
|
if (typeof(theme[prop]) === 'string') {
|
||||||
colors[prop] = colors[theme[prop]];
|
colors[prop] = colors[theme[prop]];
|
||||||
addProperty(prop, function() {
|
|
||||||
return colors[theme[prop]](this);
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
addProperty(prop, function() {
|
var tmp = colors[theme[prop][0]];
|
||||||
var ret = this;
|
for (var t = 1; t < theme[prop].length; t++) {
|
||||||
for (var t = 0; t < theme[prop].length; t++) {
|
tmp = tmp[theme[prop][t]];
|
||||||
ret = colors[theme[prop][t]](ret);
|
}
|
||||||
}
|
colors[prop] = tmp;
|
||||||
return ret;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
addProperty(prop, function() {
|
||||||
|
return colors[prop](this);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user