From 66bc08adc71cc3bda469327ac33b0abd035816f6 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 8 Jun 2021 10:05:46 +0800 Subject: [PATCH 1/2] bugfix --- src/base/1.pane.js | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/base/1.pane.js b/src/base/1.pane.js index 6bd53d848..45437bde9 100644 --- a/src/base/1.pane.js +++ b/src/base/1.pane.js @@ -20,18 +20,20 @@ BI.Pane = BI.inherit(BI.Widget, { }, _assertTip: function () { - var o = this.options; + var self = this, o = this.options; if (!this._tipText) { - this._tipText = BI.createWidget({ - type: "bi.label", - cls: "bi-tips", - text: o.tipText, - height: 25 - }); BI.createWidget({ type: "bi.absolute_center_adapt", element: this, - items: [this._tipText] + items: [{ + type: "bi.label", + ref: function (_ref) { + self._tipText = _ref; + }, + cls: "bi-tips", + text: o.tipText, + height: 25 + }] }); } }, @@ -50,17 +52,17 @@ BI.Pane = BI.inherit(BI.Widget, { type: "bi.layout", cls: "animate-rect rect1", height: this._getSize(50), - width: this._getSize(5), + width: this._getSize(5) }, { type: "bi.layout", cls: "animate-rect rect2", height: this._getSize(50), - width: this._getSize(5), + width: this._getSize(5) }, { type: "bi.layout", cls: "animate-rect rect3", height: this._getSize(50), - width: this._getSize(5), + width: this._getSize(5) }] }); // pane在同步方式下由items决定tipText的显示与否 @@ -90,8 +92,8 @@ BI.Pane = BI.inherit(BI.Widget, { this.element.addClass("loading-status"); }, - _getSize: function(v) { - return Math.ceil(v / (this.options.loadingSize === 'small' ? 2 : 1)); + _getSize: function (v) { + return Math.ceil(v / (this.options.loadingSize === "small" ? 2 : 1)); }, _getLoadingTipItems: function (loadingTip) { @@ -103,7 +105,7 @@ BI.Pane = BI.inherit(BI.Widget, { BI.isNotEmptyString(o.loadingText) && loadingTipItems.push({ type: "bi.text", text: o.loadingText, - tgap: this._getSize(10), + tgap: this._getSize(10) }); return [{ @@ -138,11 +140,7 @@ BI.Pane = BI.inherit(BI.Widget, { populate: function (items) { this.options.items = items || []; this.check(); - }, - - empty: function () { - } }); BI.Pane.EVENT_LOADED = "EVENT_LOADED"; -BI.Pane.EVENT_LOADING = "EVENT_LOADING"; \ No newline at end of file +BI.Pane.EVENT_LOADING = "EVENT_LOADING"; From 4313854b24ae1fb1a53917c18eb5f9eb44d89f8f Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 8 Jun 2021 10:22:07 +0800 Subject: [PATCH 2/2] bugfix --- src/base/1.pane.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/base/1.pane.js b/src/base/1.pane.js index 45437bde9..3a49513f1 100644 --- a/src/base/1.pane.js +++ b/src/base/1.pane.js @@ -79,13 +79,12 @@ BI.Pane = BI.inherit(BI.Widget, { } BI.Layers.show(self.getName()); } else if (BI.isNull(this._loading)) { - this._loading = loadingAnimation; - this._loading.element.css("zIndex", 1); + loadingAnimation.element.css("zIndex", 1); BI.createWidget({ type: "bi.center_adapt", element: this, cls: "loading-container", - items: this._getLoadingTipItems(this._loading) + items: this._getLoadingTipItems(loadingAnimation) }); } self.fireEvent(BI.Pane.EVENT_LOADING); @@ -97,7 +96,7 @@ BI.Pane = BI.inherit(BI.Widget, { }, _getLoadingTipItems: function (loadingTip) { - var o = this.options; + var self = this, o = this.options; var loadingTipItems = [{ type: "bi.horizontal_adapt", items: [loadingTip] @@ -110,6 +109,9 @@ BI.Pane = BI.inherit(BI.Widget, { return [{ type: "bi.vertical", + ref: function (_ref) { + self._loading = _ref; + }, items: loadingTipItems }]; }, @@ -118,7 +120,6 @@ BI.Pane = BI.inherit(BI.Widget, { var self = this, o = this.options; BI.Layers.remove(self.getName()); this._loading && this._loading.destroy(); - this._loading && (this._loading = null); o.onLoaded(); self.fireEvent(BI.Pane.EVENT_LOADED); this.element.removeClass("loading-status");