MCPcopy Create free account
hub / github.com/TruthHun/BookStack / updateStyle

Function updateStyle

static/vuejs/vue.common.js:6096–6131  ·  view source on GitHub ↗
(oldVnode, vnode)

Source from the content-addressed store, hash-verified

6094});
6095
6096function updateStyle (oldVnode, vnode) {
6097 var data = vnode.data;
6098 var oldData = oldVnode.data;
6099
6100 if (!data.staticStyle && !data.style &&
6101 !oldData.staticStyle && !oldData.style) {
6102 return
6103 }
6104
6105 var cur, name;
6106 var el = vnode.elm;
6107 var oldStaticStyle = oldVnode.data.staticStyle;
6108 var oldStyleBinding = oldVnode.data.style || {};
6109
6110 // if static style exists, stylebinding already merged into it when doing normalizeStyleData
6111 var oldStyle = oldStaticStyle || oldStyleBinding;
6112
6113 var style = normalizeStyleBinding(vnode.data.style) || {};
6114
6115 vnode.data.style = style.__ob__ ? extend({}, style) : style;
6116
6117 var newStyle = getStyle(vnode, true);
6118
6119 for (name in oldStyle) {
6120 if (newStyle[name] == null) {
6121 setProp(el, name, '');
6122 }
6123 }
6124 for (name in newStyle) {
6125 cur = newStyle[name];
6126 if (cur !== oldStyle[name]) {
6127 // ie9 setting to null has no effect, must use empty string
6128 setProp(el, name, cur == null ? '' : cur);
6129 }
6130 }
6131}
6132
6133var style = {
6134 create: updateStyle,

Callers

nothing calls this directly

Calls 4

normalizeStyleBindingFunction · 0.70
extendFunction · 0.70
getStyleFunction · 0.70
setPropFunction · 0.70

Tested by

no test coverage detected