From f4e782e2cb404c3842a5310dfbda30f77c9a9758 Mon Sep 17 00:00:00 2001 From: dailer Date: Mon, 8 Nov 2021 19:44:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20BI.Pane?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0shortcut=E5=92=8Cloading=20props?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/1.pane.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/base/1.pane.js b/src/base/1.pane.js index 5bbecf5da..e5890d14b 100644 --- a/src/base/1.pane.js +++ b/src/base/1.pane.js @@ -15,10 +15,16 @@ BI.Pane = BI.inherit(BI.Widget, { loadingText: "", loadingSize: "small", overlap: true, - onLoaded: BI.emptyFn + onLoaded: BI.emptyFn, + loading: false }); }, + _init: function () { + BI.Pane.superclass._init.apply(this, arguments); + this.options.loading && this.loading(); + }, + _assertTip: function () { var self = this, o = this.options; if (!this._tipText) { @@ -40,6 +46,7 @@ BI.Pane = BI.inherit(BI.Widget, { loading: function () { var self = this, o = this.options; + o.loading = true; var isIE = BI.isIE(); var loadingAnimation = BI.createWidget({ type: "bi.horizontal", @@ -118,6 +125,7 @@ BI.Pane = BI.inherit(BI.Widget, { loaded: function () { var self = this, o = this.options; + o.loading = false; BI.Layers.remove(self.getName() + "-loading"); this._loading && this._loading.destroy(); o.onLoaded(); @@ -150,3 +158,5 @@ BI.Pane = BI.inherit(BI.Widget, { }); BI.Pane.EVENT_LOADED = "EVENT_LOADED"; BI.Pane.EVENT_LOADING = "EVENT_LOADING"; + +BI.shortcut("bi.pane", BI.Pane);