|
|
@ -83,7 +83,6 @@ BI.Layout = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
appendFragment: function (frag) { |
|
|
|
appendFragment: function (frag) { |
|
|
|
console.debug("appendFragment:frag",frag,this.element); |
|
|
|
|
|
|
|
this.element.append(frag); |
|
|
|
this.element.append(frag); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -94,7 +93,7 @@ BI.Layout = BI.inherit(BI.Widget, { |
|
|
|
for (var key in this._children) { |
|
|
|
for (var key in this._children) { |
|
|
|
var child = this._children[key]; |
|
|
|
var child = this._children[key]; |
|
|
|
if (child.element !== self.element) { |
|
|
|
if (child.element !== self.element) { |
|
|
|
frag.appendChild(child.element);//[0] hugh java没法实现这种非数组对象又能[]的
|
|
|
|
frag.appendChild(child.element[0]); |
|
|
|
hasChild = true; |
|
|
|
hasChild = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -241,7 +240,7 @@ BI.Layout = BI.inherit(BI.Widget, { |
|
|
|
var w = this._newElement(newIndex, item); |
|
|
|
var w = this._newElement(newIndex, item); |
|
|
|
// 需要有个地方临时存一下新建的组件,否则如果直接使用newIndex的话,newIndex位置的元素可能会被用到
|
|
|
|
// 需要有个地方临时存一下新建的组件,否则如果直接使用newIndex的话,newIndex位置的元素可能会被用到
|
|
|
|
this._children[this._getChildName(newIndex) + "-temp"] = w; |
|
|
|
this._children[this._getChildName(newIndex) + "-temp"] = w; |
|
|
|
var nextSibling = del.element[0].nextSibling; |
|
|
|
var nextSibling = del.element.next(); |
|
|
|
if (nextSibling) { |
|
|
|
if (nextSibling) { |
|
|
|
BI.Widget._renderEngine.createElement(nextSibling).before(w.element); |
|
|
|
BI.Widget._renderEngine.createElement(nextSibling).before(w.element); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -421,6 +420,7 @@ BI.Layout = BI.inherit(BI.Widget, { |
|
|
|
var shouldUpdate = this.shouldUpdateItem(oldIndex, vnode); |
|
|
|
var shouldUpdate = this.shouldUpdateItem(oldIndex, vnode); |
|
|
|
var child = this._children[this._getChildName(oldIndex)]; |
|
|
|
var child = this._children[this._getChildName(oldIndex)]; |
|
|
|
if (shouldUpdate) { |
|
|
|
if (shouldUpdate) { |
|
|
|
|
|
|
|
this._children[this._getChildName(newIndex) + "-temp"] = child; |
|
|
|
return child._update(this._getOptions(vnode), shouldUpdate); |
|
|
|
return child._update(this._getOptions(vnode), shouldUpdate); |
|
|
|
} |
|
|
|
} |
|
|
|
if (shouldUpdate === null && !this._compare(oldVnode, vnode)) { |
|
|
|
if (shouldUpdate === null && !this._compare(oldVnode, vnode)) { |
|
|
|