Browse Source

Pull request #1525: BI-73644 pane和loadingPane支持加载时自定义提示文本

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit 'ca8fa7187473615acdb868d888a12c2734075d09':
  update
  BI-73644 pane和loadingPane支持加载时自定义提示文本
es6
windy 4 years ago
parent
commit
7dac06bc01
  1. 3
      changelog.md
  2. 33
      src/base/pane.js

3
changelog.md

@ -1,4 +1,7 @@
# 更新日志 # 更新日志
2.0(2020-10)
- pane和loadingPane支持加载时自定义提示文本
2.0(2020-09) 2.0(2020-09)
- combo增加click-blur(点击显示,blur消失)作为触发条件功能 - combo增加click-blur(点击显示,blur消失)作为触发条件功能
- allCountPager支持是否显示总行数 - allCountPager支持是否显示总行数

33
src/base/pane.js

@ -12,6 +12,7 @@ BI.Pane = BI.inherit(BI.Widget, {
return BI.extend(BI.Pane.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.Pane.superclass._defaultConfig.apply(this, arguments), {
_baseCls: "bi-pane", _baseCls: "bi-pane",
tipText: BI.i18nText("BI-No_Selected_Item"), tipText: BI.i18nText("BI-No_Selected_Item"),
loadingText: "",
overlap: true, overlap: true,
onLoaded: BI.emptyFn onLoaded: BI.emptyFn
}); });
@ -67,11 +68,9 @@ BI.Pane = BI.inherit(BI.Widget, {
if (o.overlap === true) { if (o.overlap === true) {
if (!BI.Layers.has(this.getName())) { if (!BI.Layers.has(this.getName())) {
BI.createWidget({ BI.createWidget({
type: "bi.absolute_center_adapt", type: "bi.center_adapt",
cls: "loading-container", cls: "loading-container",
items: [{ items: this._getLoadingTipItems(loadingAnimation),
el: loadingAnimation
}],
element: BI.Layers.make(this.getName(), this) element: BI.Layers.make(this.getName(), this)
}); });
} }
@ -80,20 +79,32 @@ BI.Pane = BI.inherit(BI.Widget, {
this._loading = loadingAnimation; this._loading = loadingAnimation;
this._loading.element.css("zIndex", 1); this._loading.element.css("zIndex", 1);
BI.createWidget({ BI.createWidget({
type: "bi.absolute_center_adapt", type: "bi.center_adapt",
element: this, element: this,
cls: "loading-container", cls: "loading-container",
items: [{ items: this._getLoadingTipItems(this._loading)
el: this._loading,
left: 0,
right: 0,
top: 0
}]
}); });
} }
this.element.addClass("loading-status"); this.element.addClass("loading-status");
}, },
_getLoadingTipItems: function (loadingTip) {
var o = this.options;
var loadingTipItems = [{
type: "bi.horizontal_adapt",
items: [loadingTip]
}];
BI.isNotEmptyString(o.loadingText) && loadingTipItems.push({
type: "bi.text",
text: o.loadingText
});
return [{
type: "bi.vertical",
items: loadingTipItems
}];
},
loaded: function () { loaded: function () {
var self = this, o = this.options; var self = this, o = this.options;
BI.Layers.remove(self.getName()); BI.Layers.remove(self.getName());

Loading…
Cancel
Save