Pendigard's picture
Upload folder using huggingface_hub (part 43)
cbc76af verified
Raw History Blame Contribute Delete
484 Bytes
ko.bindingHandlers['style'] = {
'update': function (element, valueAccessor) {
var value = ko.utils.unwrapObservable(valueAccessor() || {});
for (var styleName in value) {
if (typeof styleName == "string") {
var styleValue = ko.utils.unwrapObservable(value[styleName]);
element.style[styleName] = styleValue || ""; // Empty string removes the value, whereas null/undefined have no effect
}
}
}
};