From b894a850a8e8bf5cb1bceed91f0a89df965bb39b Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 28 Mar 2017 22:43:49 +0800 Subject: [PATCH] add --- bi/base.css | 2 +- bi/core.js | 18 +++++++++--------- demo/js/core/abstract/demo.virtual_group.js | 1 + dist/base.css | 2 +- dist/core.js | 18 +++++++++--------- src/core/base.js | 7 +++---- src/core/widget.js | 5 +++-- src/core/wrapper/layout.js | 6 +++--- 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/bi/base.css b/bi/base.css index a97667728..542cd75be 100644 --- a/bi/base.css +++ b/bi/base.css @@ -1035,7 +1035,7 @@ li.CodeMirror-hint-active { overflow-x: hidden; overflow-y: hidden; white-space: nowrap; - word-break: break-all; + word-break: break-word; } /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ diff --git a/bi/core.js b/bi/core.js index e065a7a4b..dad5b489d 100644 --- a/bi/core.js +++ b/bi/core.js @@ -2036,7 +2036,7 @@ if (!window.BI) { }, formatEL: function (obj) { - if (obj && obj.el) { + if (obj && !obj.type && obj.el) { return obj; } return { @@ -2995,9 +2995,8 @@ if (!window.BI) { option.data = BI.cjkEncodeDO(option.data); - - - + + $.ajax({ url: option.url, type: "POST", @@ -4458,7 +4457,8 @@ BI.Widget = BI.inherit(BI.OB, { mounted: null, - update: null, + update: function () { + }, destroyed: null, @@ -4682,7 +4682,7 @@ BI.Widget = BI.inherit(BI.OB, { } widget._setParent && widget._setParent(this); widget.on(BI.Events.DESTROY, function () { - delete self._children[name] + BI.remove(self._children, this); }); return (this._children[name] = widget); }, @@ -11445,9 +11445,9 @@ BI.Layout = BI.inherit(BI.Widget, { } var child = this._children[this._getChildName(index)]; - if (child.update) { - child.update(this._getOptions(item)); - return true; + var updated; + if (updated = child.update(this._getOptions(item))) { + return updated; } var del = this._children[this._getChildName(index)]; delete this._children[this._getChildName(index)]; diff --git a/demo/js/core/abstract/demo.virtual_group.js b/demo/js/core/abstract/demo.virtual_group.js index c933aa7b6..eb7507138 100644 --- a/demo/js/core/abstract/demo.virtual_group.js +++ b/demo/js/core/abstract/demo.virtual_group.js @@ -66,6 +66,7 @@ Demo.Item = BI.inherit(BI.Widget, { update: function (item) { this.label.setText(item.value); console.log("更新了一项"); + return true; }, created: function () { diff --git a/dist/base.css b/dist/base.css index a97667728..542cd75be 100644 --- a/dist/base.css +++ b/dist/base.css @@ -1035,7 +1035,7 @@ li.CodeMirror-hint-active { overflow-x: hidden; overflow-y: hidden; white-space: nowrap; - word-break: break-all; + word-break: break-word; } /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ diff --git a/dist/core.js b/dist/core.js index efa58d6bb..b3875a09c 100644 --- a/dist/core.js +++ b/dist/core.js @@ -13052,7 +13052,7 @@ if (!window.BI) { }, formatEL: function (obj) { - if (obj && obj.el) { + if (obj && !obj.type && obj.el) { return obj; } return { @@ -14011,9 +14011,8 @@ if (!window.BI) { option.data = BI.cjkEncodeDO(option.data); - - - + + $.ajax({ url: option.url, type: "POST", @@ -14370,7 +14369,8 @@ BI.Widget = BI.inherit(BI.OB, { mounted: null, - update: null, + update: function () { + }, destroyed: null, @@ -14594,7 +14594,7 @@ BI.Widget = BI.inherit(BI.OB, { } widget._setParent && widget._setParent(this); widget.on(BI.Events.DESTROY, function () { - delete self._children[name] + BI.remove(self._children, this); }); return (this._children[name] = widget); }, @@ -19578,9 +19578,9 @@ BI.Layout = BI.inherit(BI.Widget, { } var child = this._children[this._getChildName(index)]; - if (child.update) { - child.update(this._getOptions(item)); - return true; + var updated; + if (updated = child.update(this._getOptions(item))) { + return updated; } var del = this._children[this._getChildName(index)]; delete this._children[this._getChildName(index)]; diff --git a/src/core/base.js b/src/core/base.js index ddfe30fa9..e91ddc164 100644 --- a/src/core/base.js +++ b/src/core/base.js @@ -141,7 +141,7 @@ if (!window.BI) { }, formatEL: function (obj) { - if (obj && obj.el) { + if (obj && !obj.type && obj.el) { return obj; } return { @@ -1100,9 +1100,8 @@ if (!window.BI) { option.data = BI.cjkEncodeDO(option.data); - - - + + $.ajax({ url: option.url, type: "POST", diff --git a/src/core/widget.js b/src/core/widget.js index 2f4f3d390..dcc30ec9d 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -34,7 +34,8 @@ BI.Widget = BI.inherit(BI.OB, { mounted: null, - update: null, + update: function () { + }, destroyed: null, @@ -258,7 +259,7 @@ BI.Widget = BI.inherit(BI.OB, { } widget._setParent && widget._setParent(this); widget.on(BI.Events.DESTROY, function () { - delete self._children[name] + BI.remove(self._children, this); }); return (this._children[name] = widget); }, diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index f4b0dbd48..5a4a6931f 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -246,9 +246,9 @@ BI.Layout = BI.inherit(BI.Widget, { } var child = this._children[this._getChildName(index)]; - if (child.update) { - child.update(this._getOptions(item)); - return true; + var updated; + if (updated = child.update(this._getOptions(item))) { + return updated; } var del = this._children[this._getChildName(index)]; delete this._children[this._getChildName(index)];