Fix #180 - Custom with multi attr failure

Fix #180 - Themes can have multiple attributes - but not in safe mode
This commit is contained in:
zucher 2018-06-25 14:37:45 +02:00 committed by GitHub
parent a8ce90c51c
commit dee3ab0494
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,18 +73,16 @@ module['exports'] = function() {
} else {
if (typeof(theme[prop]) === 'string') {
colors[prop] = colors[theme[prop]];
addProperty(prop, function() {
return colors[theme[prop]](this);
});
} else {
addProperty(prop, function() {
var ret = this;
for (var t = 0; t < theme[prop].length; t++) {
ret = colors[theme[prop][t]](ret);
}
return ret;
});
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() {
return colors[prop](this);
});
}
});
}