Tab layout, first commit with new third party packages
[openemr.git] / public / assets / knockout-3-4-0 / src / binding / defaultBindings / style.js
blob4b2622a79495f5108cc2758eee5de049b5eb1553
1 ko.bindingHandlers['style'] = {
2     'update': function (element, valueAccessor) {
3         var value = ko.utils.unwrapObservable(valueAccessor() || {});
4         ko.utils.objectForEach(value, function(styleName, styleValue) {
5             styleValue = ko.utils.unwrapObservable(styleValue);
7             if (styleValue === null || styleValue === undefined || styleValue === false) {
8                 // Empty string removes the value, whereas null/undefined have no effect
9                 styleValue = "";
10             }
12             element.style[styleName] = styleValue;
13         });
14     }