From a2a64e0829e14a0c6f2ddbea8e94d84fa1d1b13b Mon Sep 17 00:00:00 2001 From: Young Date: Fri, 13 Oct 2017 20:03:43 +0800 Subject: [PATCH] layout updateChildren --- bi/core.js | 4 ++++ dist/bundle.js | 4 ++++ dist/core.js | 4 ++++ src/core/wrapper/layout.js | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/bi/core.js b/bi/core.js index 67c0f1ee8..5f6c5c308 100644 --- a/bi/core.js +++ b/bi/core.js @@ -11564,19 +11564,23 @@ BI.Layout = BI.inherit(BI.Widget, { oldEndVnode = oldCh[--oldEndIdx]; } else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) { updated = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx) || updated; + children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)]; oldStartVnode = oldCh[++oldStartIdx]; newStartVnode = newCh[++newStartIdx]; } else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) { updated = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx) || updated; + children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)]; oldEndVnode = oldCh[--oldEndIdx]; newEndVnode = newCh[--newEndIdx]; } else if (sameVnode(oldStartVnode, newEndVnode)) { updated = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx) || updated; + children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)]; insertBefore(oldStartVnode, oldEndVnode, true); oldStartVnode = oldCh[++oldStartIdx]; newEndVnode = newCh[--newEndIdx]; } else if (sameVnode(oldEndVnode, newStartVnode)) { updated = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx) || updated; + children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)]; insertBefore(oldEndVnode, oldStartVnode); oldEndVnode = oldCh[--oldEndIdx]; newStartVnode = newCh[++newStartIdx]; diff --git a/dist/bundle.js b/dist/bundle.js index fbbbe6129..0d034c5d9 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -19920,19 +19920,23 @@ BI.Layout = BI.inherit(BI.Widget, { oldEndVnode = oldCh[--oldEndIdx]; } else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) { updated = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx) || updated; + children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)]; oldStartVnode = oldCh[++oldStartIdx]; newStartVnode = newCh[++newStartIdx]; } else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) { updated = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx) || updated; + children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)]; oldEndVnode = oldCh[--oldEndIdx]; newEndVnode = newCh[--newEndIdx]; } else if (sameVnode(oldStartVnode, newEndVnode)) { updated = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx) || updated; + children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)]; insertBefore(oldStartVnode, oldEndVnode, true); oldStartVnode = oldCh[++oldStartIdx]; newEndVnode = newCh[--newEndIdx]; } else if (sameVnode(oldEndVnode, newStartVnode)) { updated = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx) || updated; + children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)]; insertBefore(oldEndVnode, oldStartVnode); oldEndVnode = oldCh[--oldEndIdx]; newStartVnode = newCh[++newStartIdx]; diff --git a/dist/core.js b/dist/core.js index f03c80a3a..f36f46bee 100644 --- a/dist/core.js +++ b/dist/core.js @@ -19869,19 +19869,23 @@ BI.Layout = BI.inherit(BI.Widget, { oldEndVnode = oldCh[--oldEndIdx]; } else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) { updated = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx) || updated; + children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)]; oldStartVnode = oldCh[++oldStartIdx]; newStartVnode = newCh[++newStartIdx]; } else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) { updated = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx) || updated; + children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)]; oldEndVnode = oldCh[--oldEndIdx]; newEndVnode = newCh[--newEndIdx]; } else if (sameVnode(oldStartVnode, newEndVnode)) { updated = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx) || updated; + children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)]; insertBefore(oldStartVnode, oldEndVnode, true); oldStartVnode = oldCh[++oldStartIdx]; newEndVnode = newCh[--newEndIdx]; } else if (sameVnode(oldEndVnode, newStartVnode)) { updated = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx) || updated; + children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)]; insertBefore(oldEndVnode, oldStartVnode); oldEndVnode = oldCh[--oldEndIdx]; newStartVnode = newCh[++newStartIdx]; diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index e2dd304cf..c96cba4f6 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -380,19 +380,23 @@ BI.Layout = BI.inherit(BI.Widget, { oldEndVnode = oldCh[--oldEndIdx]; } else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) { updated = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx) || updated; + children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)]; oldStartVnode = oldCh[++oldStartIdx]; newStartVnode = newCh[++newStartIdx]; } else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) { updated = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx) || updated; + children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)]; oldEndVnode = oldCh[--oldEndIdx]; newEndVnode = newCh[--newEndIdx]; } else if (sameVnode(oldStartVnode, newEndVnode)) { updated = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx) || updated; + children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)]; insertBefore(oldStartVnode, oldEndVnode, true); oldStartVnode = oldCh[++oldStartIdx]; newEndVnode = newCh[--newEndIdx]; } else if (sameVnode(oldEndVnode, newStartVnode)) { updated = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx) || updated; + children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)]; insertBefore(oldEndVnode, oldStartVnode); oldEndVnode = oldCh[--oldEndIdx]; newStartVnode = newCh[++newStartIdx];