Browse Source

无JIRA任务 BI.Pane增加shortcut和loading props

es6
dailer 3 years ago
parent
commit
f4e782e2cb
  1. 12
      src/base/1.pane.js

12
src/base/1.pane.js

@ -15,10 +15,16 @@ BI.Pane = BI.inherit(BI.Widget, {
loadingText: "", loadingText: "",
loadingSize: "small", loadingSize: "small",
overlap: true, 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 () { _assertTip: function () {
var self = this, o = this.options; var self = this, o = this.options;
if (!this._tipText) { if (!this._tipText) {
@ -40,6 +46,7 @@ BI.Pane = BI.inherit(BI.Widget, {
loading: function () { loading: function () {
var self = this, o = this.options; var self = this, o = this.options;
o.loading = true;
var isIE = BI.isIE(); var isIE = BI.isIE();
var loadingAnimation = BI.createWidget({ var loadingAnimation = BI.createWidget({
type: "bi.horizontal", type: "bi.horizontal",
@ -118,6 +125,7 @@ BI.Pane = BI.inherit(BI.Widget, {
loaded: function () { loaded: function () {
var self = this, o = this.options; var self = this, o = this.options;
o.loading = false;
BI.Layers.remove(self.getName() + "-loading"); BI.Layers.remove(self.getName() + "-loading");
this._loading && this._loading.destroy(); this._loading && this._loading.destroy();
o.onLoaded(); o.onLoaded();
@ -150,3 +158,5 @@ BI.Pane = BI.inherit(BI.Widget, {
}); });
BI.Pane.EVENT_LOADED = "EVENT_LOADED"; BI.Pane.EVENT_LOADED = "EVENT_LOADED";
BI.Pane.EVENT_LOADING = "EVENT_LOADING"; BI.Pane.EVENT_LOADING = "EVENT_LOADING";
BI.shortcut("bi.pane", BI.Pane);

Loading…
Cancel
Save