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

Function updateStyle

static/vuejs/vue.runtime.js:5642–5677  ·  view source on GitHub ↗
(oldVnode, vnode)

Source from the content-addressed store, hash-verified

5640});
5641
5642function updateStyle (oldVnode, vnode) {
5643 var data = vnode.data;
5644 var oldData = oldVnode.data;
5645
5646 if (!data.staticStyle && !data.style &&
5647 !oldData.staticStyle && !oldData.style) {
5648 return
5649 }
5650
5651 var cur, name;
5652 var el = vnode.elm;
5653 var oldStaticStyle = oldVnode.data.staticStyle;
5654 var oldStyleBinding = oldVnode.data.style || {};
5655
5656 // if static style exists, stylebinding already merged into it when doing normalizeStyleData
5657 var oldStyle = oldStaticStyle || oldStyleBinding;
5658
5659 var style = normalizeStyleBinding(vnode.data.style) || {};
5660
5661 vnode.data.style = style.__ob__ ? extend({}, style) : style;
5662
5663 var newStyle = getStyle(vnode, true);
5664
5665 for (name in oldStyle) {
5666 if (newStyle[name] == null) {
5667 setProp(el, name, '');
5668 }
5669 }
5670 for (name in newStyle) {
5671 cur = newStyle[name];
5672 if (cur !== oldStyle[name]) {
5673 // ie9 setting to null has no effect, must use empty string
5674 setProp(el, name, cur == null ? '' : cur);
5675 }
5676 }
5677}
5678
5679var style = {
5680 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