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

Function updateStyle

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

Source from the content-addressed store, hash-verified

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