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

Function updateStyle

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

Source from the content-addressed store, hash-verified

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