|
|
@ -20,18 +20,20 @@ BI.Pane = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_assertTip: function () { |
|
|
|
_assertTip: function () { |
|
|
|
var o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
if (!this._tipText) { |
|
|
|
if (!this._tipText) { |
|
|
|
this._tipText = BI.createWidget({ |
|
|
|
BI.createWidget({ |
|
|
|
|
|
|
|
type: "bi.absolute_center_adapt", |
|
|
|
|
|
|
|
element: this, |
|
|
|
|
|
|
|
items: [{ |
|
|
|
type: "bi.label", |
|
|
|
type: "bi.label", |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self._tipText = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
cls: "bi-tips", |
|
|
|
cls: "bi-tips", |
|
|
|
text: o.tipText, |
|
|
|
text: o.tipText, |
|
|
|
height: 25 |
|
|
|
height: 25 |
|
|
|
}); |
|
|
|
}] |
|
|
|
BI.createWidget({ |
|
|
|
|
|
|
|
type: "bi.absolute_center_adapt", |
|
|
|
|
|
|
|
element: this, |
|
|
|
|
|
|
|
items: [this._tipText] |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -50,17 +52,17 @@ BI.Pane = BI.inherit(BI.Widget, { |
|
|
|
type: "bi.layout", |
|
|
|
type: "bi.layout", |
|
|
|
cls: "animate-rect rect1", |
|
|
|
cls: "animate-rect rect1", |
|
|
|
height: this._getSize(50), |
|
|
|
height: this._getSize(50), |
|
|
|
width: this._getSize(5), |
|
|
|
width: this._getSize(5) |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
type: "bi.layout", |
|
|
|
type: "bi.layout", |
|
|
|
cls: "animate-rect rect2", |
|
|
|
cls: "animate-rect rect2", |
|
|
|
height: this._getSize(50), |
|
|
|
height: this._getSize(50), |
|
|
|
width: this._getSize(5), |
|
|
|
width: this._getSize(5) |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
type: "bi.layout", |
|
|
|
type: "bi.layout", |
|
|
|
cls: "animate-rect rect3", |
|
|
|
cls: "animate-rect rect3", |
|
|
|
height: this._getSize(50), |
|
|
|
height: this._getSize(50), |
|
|
|
width: this._getSize(5), |
|
|
|
width: this._getSize(5) |
|
|
|
}] |
|
|
|
}] |
|
|
|
}); |
|
|
|
}); |
|
|
|
// pane在同步方式下由items决定tipText的显示与否
|
|
|
|
// pane在同步方式下由items决定tipText的显示与否
|
|
|
@ -77,13 +79,12 @@ BI.Pane = BI.inherit(BI.Widget, { |
|
|
|
} |
|
|
|
} |
|
|
|
BI.Layers.show(self.getName()); |
|
|
|
BI.Layers.show(self.getName()); |
|
|
|
} else if (BI.isNull(this._loading)) { |
|
|
|
} else if (BI.isNull(this._loading)) { |
|
|
|
this._loading = loadingAnimation; |
|
|
|
loadingAnimation.element.css("zIndex", 1); |
|
|
|
this._loading.element.css("zIndex", 1); |
|
|
|
|
|
|
|
BI.createWidget({ |
|
|
|
BI.createWidget({ |
|
|
|
type: "bi.center_adapt", |
|
|
|
type: "bi.center_adapt", |
|
|
|
element: this, |
|
|
|
element: this, |
|
|
|
cls: "loading-container", |
|
|
|
cls: "loading-container", |
|
|
|
items: this._getLoadingTipItems(this._loading) |
|
|
|
items: this._getLoadingTipItems(loadingAnimation) |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
self.fireEvent(BI.Pane.EVENT_LOADING); |
|
|
|
self.fireEvent(BI.Pane.EVENT_LOADING); |
|
|
@ -91,11 +92,11 @@ BI.Pane = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_getSize: function (v) { |
|
|
|
_getSize: function (v) { |
|
|
|
return Math.ceil(v / (this.options.loadingSize === 'small' ? 2 : 1)); |
|
|
|
return Math.ceil(v / (this.options.loadingSize === "small" ? 2 : 1)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_getLoadingTipItems: function (loadingTip) { |
|
|
|
_getLoadingTipItems: function (loadingTip) { |
|
|
|
var o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
var loadingTipItems = [{ |
|
|
|
var loadingTipItems = [{ |
|
|
|
type: "bi.horizontal_adapt", |
|
|
|
type: "bi.horizontal_adapt", |
|
|
|
items: [loadingTip] |
|
|
|
items: [loadingTip] |
|
|
@ -103,11 +104,14 @@ BI.Pane = BI.inherit(BI.Widget, { |
|
|
|
BI.isNotEmptyString(o.loadingText) && loadingTipItems.push({ |
|
|
|
BI.isNotEmptyString(o.loadingText) && loadingTipItems.push({ |
|
|
|
type: "bi.text", |
|
|
|
type: "bi.text", |
|
|
|
text: o.loadingText, |
|
|
|
text: o.loadingText, |
|
|
|
tgap: this._getSize(10), |
|
|
|
tgap: this._getSize(10) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return [{ |
|
|
|
return [{ |
|
|
|
type: "bi.vertical", |
|
|
|
type: "bi.vertical", |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self._loading = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
items: loadingTipItems |
|
|
|
items: loadingTipItems |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -116,7 +120,6 @@ BI.Pane = BI.inherit(BI.Widget, { |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
BI.Layers.remove(self.getName()); |
|
|
|
BI.Layers.remove(self.getName()); |
|
|
|
this._loading && this._loading.destroy(); |
|
|
|
this._loading && this._loading.destroy(); |
|
|
|
this._loading && (this._loading = null); |
|
|
|
|
|
|
|
o.onLoaded(); |
|
|
|
o.onLoaded(); |
|
|
|
self.fireEvent(BI.Pane.EVENT_LOADED); |
|
|
|
self.fireEvent(BI.Pane.EVENT_LOADED); |
|
|
|
this.element.removeClass("loading-status"); |
|
|
|
this.element.removeClass("loading-status"); |
|
|
@ -138,10 +141,6 @@ BI.Pane = BI.inherit(BI.Widget, { |
|
|
|
populate: function (items) { |
|
|
|
populate: function (items) { |
|
|
|
this.options.items = items || []; |
|
|
|
this.options.items = items || []; |
|
|
|
this.check(); |
|
|
|
this.check(); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
empty: function () { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.Pane.EVENT_LOADED = "EVENT_LOADED"; |
|
|
|
BI.Pane.EVENT_LOADED = "EVENT_LOADED"; |
|
|
|