Browse Source

Merge pull request #804 in VISUAL/fineui from ~YOUNG/fineui:master to master

* commit '6749f2958ecd77c6b9d2ae0aba46b79d3369e777':
  update
  update
  update 抽出beforeInit相关逻辑,在LoadingPane中重写loading情况下的render逻辑
  update 去掉pane中无效方法
  无JIRA任务 获取数据后渲染页面loading效果
es6
windy 6 years ago
parent
commit
5e77986a58
  1. 29
      demo/js/config/demo.pane.js
  2. 14
      dist/base.js
  3. 48
      dist/bundle.ie.js
  4. 24
      dist/bundle.ie.min.js
  5. 48
      dist/bundle.js
  6. 2
      dist/bundle.min.css
  7. 24
      dist/bundle.min.js
  8. 30
      dist/case.js
  9. 4
      dist/core.js
  10. 55
      dist/demo.js
  11. 48
      dist/fineui.ie.js
  12. 22
      dist/fineui.ie.min.js
  13. 48
      dist/fineui.js
  14. 2
      dist/fineui.min.css
  15. 22
      dist/fineui.min.js
  16. 48
      dist/fineui_without_jquery_polyfill.js
  17. 2
      dist/utils.min.js
  18. 14
      src/base/pane.js
  19. 31
      src/case/loading/loading_pane.js
  20. 4
      src/core/widget.js

29
demo/js/config/demo.pane.js

@ -0,0 +1,29 @@
/**
* author: young
* createdDate: 2018/11/30
* description:
*/
!(function () {
var Pane = BI.inherit(BI.LoadingPane, {
props: {
},
render: function () {
return {
type: "bi.center_adapt",
items: [{
type: "bi.label",
text: "this is pane center"
}]
};
},
beforeInit: function (callback) {
setTimeout(function () {
callback();
}, 3000);
}
});
BI.shortcut("demo.pane", Pane);
})();

14
dist/base.js vendored

@ -218,20 +218,6 @@ BI.Pane = BI.inherit(BI.Widget, {
}); });
}, },
_init: function () {
BI.Pane.superclass._init.apply(this, arguments);
if (this.__async) {
this.loading();
}
},
_render: function () {
BI.Pane.superclass._render.apply(this, arguments);
if (this.__async) {
this.loaded();
}
},
_assertTip: function () { _assertTip: function () {
var o = this.options; var o = this.options;
if (!this._tipText) { if (!this._tipText) {

48
dist/bundle.ie.js vendored

@ -11771,6 +11771,10 @@ if (!_global.BI) {
this._initElementHeight(); this._initElementHeight();
this._initVisual(); this._initVisual();
this._initState(); this._initState();
this._initRender();
},
_initRender: function () {
if (this.beforeInit) { if (this.beforeInit) {
this.__asking = true; this.__asking = true;
this.beforeInit(BI.bind(this._render, this)); this.beforeInit(BI.bind(this._render, this));
@ -35304,20 +35308,6 @@ BI.Pane = BI.inherit(BI.Widget, {
}); });
}, },
_init: function () {
BI.Pane.superclass._init.apply(this, arguments);
if (this.__async) {
this.loading();
}
},
_render: function () {
BI.Pane.superclass._render.apply(this, arguments);
if (this.__async) {
this.loaded();
}
},
_assertTip: function () { _assertTip: function () {
var o = this.options; var o = this.options;
if (!this._tipText) { if (!this._tipText) {
@ -57185,6 +57175,36 @@ BI.SortList = BI.inherit(BI.Widget, {
BI.SortList.EVENT_CHANGE = "EVENT_CHANGE"; BI.SortList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.sort_list", BI.SortList); BI.shortcut("bi.sort_list", BI.SortList);
/** /**
* author: young
* createdDate: 2018/12/18
* description:
*/
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
var isMounted = BI.Pane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
this._render();
}
});/**
* 有总页数和总行数的分页控件 * 有总页数和总行数的分页控件
* Created by Young's on 2016/10/13. * Created by Young's on 2016/10/13.
*/ */

24
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

48
dist/bundle.js vendored

@ -11771,6 +11771,10 @@ if (!_global.BI) {
this._initElementHeight(); this._initElementHeight();
this._initVisual(); this._initVisual();
this._initState(); this._initState();
this._initRender();
},
_initRender: function () {
if (this.beforeInit) { if (this.beforeInit) {
this.__asking = true; this.__asking = true;
this.beforeInit(BI.bind(this._render, this)); this.beforeInit(BI.bind(this._render, this));
@ -35708,20 +35712,6 @@ BI.Pane = BI.inherit(BI.Widget, {
}); });
}, },
_init: function () {
BI.Pane.superclass._init.apply(this, arguments);
if (this.__async) {
this.loading();
}
},
_render: function () {
BI.Pane.superclass._render.apply(this, arguments);
if (this.__async) {
this.loaded();
}
},
_assertTip: function () { _assertTip: function () {
var o = this.options; var o = this.options;
if (!this._tipText) { if (!this._tipText) {
@ -57589,6 +57579,36 @@ BI.SortList = BI.inherit(BI.Widget, {
BI.SortList.EVENT_CHANGE = "EVENT_CHANGE"; BI.SortList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.sort_list", BI.SortList); BI.shortcut("bi.sort_list", BI.SortList);
/** /**
* author: young
* createdDate: 2018/12/18
* description:
*/
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
var isMounted = BI.Pane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
this._render();
}
});/**
* 有总页数和总行数的分页控件 * 有总页数和总行数的分页控件
* Created by Young's on 2016/10/13. * Created by Young's on 2016/10/13.
*/ */

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

24
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

30
dist/case.js vendored

@ -7973,6 +7973,36 @@ BI.SortList = BI.inherit(BI.Widget, {
BI.SortList.EVENT_CHANGE = "EVENT_CHANGE"; BI.SortList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.sort_list", BI.SortList); BI.shortcut("bi.sort_list", BI.SortList);
/** /**
* author: young
* createdDate: 2018/12/18
* description:
*/
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
var isMounted = BI.Pane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
this._render();
}
});/**
* 有总页数和总行数的分页控件 * 有总页数和总行数的分页控件
* Created by Young's on 2016/10/13. * Created by Young's on 2016/10/13.
*/ */

4
dist/core.js vendored

@ -11771,6 +11771,10 @@ if (!_global.BI) {
this._initElementHeight(); this._initElementHeight();
this._initVisual(); this._initVisual();
this._initState(); this._initState();
this._initRender();
},
_initRender: function () {
if (this.beforeInit) { if (this.beforeInit) {
this.__asking = true; this.__asking = true;
this.beforeInit(BI.bind(this._render, this)); this.beforeInit(BI.bind(this._render, this));

55
dist/demo.js vendored

@ -3498,7 +3498,35 @@ Demo.COMPONENT_CONFIG = [{
pId: 1, pId: 1,
text: "Pane(继承)", text: "Pane(继承)",
value: "demo.pane" value: "demo.pane"
}];// 定义Model路由 }];/**
* author: young
* createdDate: 2018/11/30
* description:
*/
!(function () {
var Pane = BI.inherit(BI.LoadingPane, {
props: {
},
render: function () {
return {
type: "bi.center_adapt",
items: [{
type: "bi.label",
text: "this is pane center"
}]
};
},
beforeInit: function (callback) {
setTimeout(function () {
callback();
}, 3000);
}
});
BI.shortcut("demo.pane", Pane);
})();// 定义Model路由
var modelRouter = new (BI.inherit(BI.WRouter, { var modelRouter = new (BI.inherit(BI.WRouter, {
routes: { routes: {
"": "index" "": "index"
@ -6130,30 +6158,7 @@ Demo.HtapeLayout = BI.inherit(BI.Widget, {
}; };
} }
}); });
BI.shortcut("demo.htape", Demo.HtapeLayout);Demo.InlineVerticalLayout = BI.inherit(BI.Widget, { BI.shortcut("demo.htape", Demo.HtapeLayout);/**
props: {
baseCls: "demo-absolute"
},
render: function () {
return {
type: "bi.inline_vertical_adapt",
items: [{
type: "bi.label",
text: "绝对布局",
cls: "layout-bg1",
width: 300,
height: 200
}, {
type: "bi.label",
text: "绝对布局",
cls: "layout-bg1",
width: 300,
height: 100
}]
};
}
});
BI.shortcut("demo.inline_vertical", Demo.InlineVerticalLayout);/**
* Created by User on 2017/3/22. * Created by User on 2017/3/22.
*/ */
Demo.LeftRightVerticalAdaptLayout = BI.inherit(BI.Widget, { Demo.LeftRightVerticalAdaptLayout = BI.inherit(BI.Widget, {

48
dist/fineui.ie.js vendored

@ -12016,6 +12016,10 @@ if (!_global.BI) {
this._initElementHeight(); this._initElementHeight();
this._initVisual(); this._initVisual();
this._initState(); this._initState();
this._initRender();
},
_initRender: function () {
if (this.beforeInit) { if (this.beforeInit) {
this.__asking = true; this.__asking = true;
this.beforeInit(BI.bind(this._render, this)); this.beforeInit(BI.bind(this._render, this));
@ -35549,20 +35553,6 @@ BI.Pane = BI.inherit(BI.Widget, {
}); });
}, },
_init: function () {
BI.Pane.superclass._init.apply(this, arguments);
if (this.__async) {
this.loading();
}
},
_render: function () {
BI.Pane.superclass._render.apply(this, arguments);
if (this.__async) {
this.loaded();
}
},
_assertTip: function () { _assertTip: function () {
var o = this.options; var o = this.options;
if (!this._tipText) { if (!this._tipText) {
@ -57430,6 +57420,36 @@ BI.SortList = BI.inherit(BI.Widget, {
BI.SortList.EVENT_CHANGE = "EVENT_CHANGE"; BI.SortList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.sort_list", BI.SortList); BI.shortcut("bi.sort_list", BI.SortList);
/** /**
* author: young
* createdDate: 2018/12/18
* description:
*/
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
var isMounted = BI.Pane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
this._render();
}
});/**
* 有总页数和总行数的分页控件 * 有总页数和总行数的分页控件
* Created by Young's on 2016/10/13. * Created by Young's on 2016/10/13.
*/ */

22
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

48
dist/fineui.js vendored

@ -12016,6 +12016,10 @@ if (!_global.BI) {
this._initElementHeight(); this._initElementHeight();
this._initVisual(); this._initVisual();
this._initState(); this._initState();
this._initRender();
},
_initRender: function () {
if (this.beforeInit) { if (this.beforeInit) {
this.__asking = true; this.__asking = true;
this.beforeInit(BI.bind(this._render, this)); this.beforeInit(BI.bind(this._render, this));
@ -35953,20 +35957,6 @@ BI.Pane = BI.inherit(BI.Widget, {
}); });
}, },
_init: function () {
BI.Pane.superclass._init.apply(this, arguments);
if (this.__async) {
this.loading();
}
},
_render: function () {
BI.Pane.superclass._render.apply(this, arguments);
if (this.__async) {
this.loaded();
}
},
_assertTip: function () { _assertTip: function () {
var o = this.options; var o = this.options;
if (!this._tipText) { if (!this._tipText) {
@ -57834,6 +57824,36 @@ BI.SortList = BI.inherit(BI.Widget, {
BI.SortList.EVENT_CHANGE = "EVENT_CHANGE"; BI.SortList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.sort_list", BI.SortList); BI.shortcut("bi.sort_list", BI.SortList);
/** /**
* author: young
* createdDate: 2018/12/18
* description:
*/
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
var isMounted = BI.Pane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
this._render();
}
});/**
* 有总页数和总行数的分页控件 * 有总页数和总行数的分页控件
* Created by Young's on 2016/10/13. * Created by Young's on 2016/10/13.
*/ */

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

22
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

48
dist/fineui_without_jquery_polyfill.js vendored

@ -11771,6 +11771,10 @@ if (!_global.BI) {
this._initElementHeight(); this._initElementHeight();
this._initVisual(); this._initVisual();
this._initState(); this._initState();
this._initRender();
},
_initRender: function () {
if (this.beforeInit) { if (this.beforeInit) {
this.__asking = true; this.__asking = true;
this.beforeInit(BI.bind(this._render, this)); this.beforeInit(BI.bind(this._render, this));
@ -24460,20 +24464,6 @@ BI.Pane = BI.inherit(BI.Widget, {
}); });
}, },
_init: function () {
BI.Pane.superclass._init.apply(this, arguments);
if (this.__async) {
this.loading();
}
},
_render: function () {
BI.Pane.superclass._render.apply(this, arguments);
if (this.__async) {
this.loaded();
}
},
_assertTip: function () { _assertTip: function () {
var o = this.options; var o = this.options;
if (!this._tipText) { if (!this._tipText) {
@ -40847,6 +40837,36 @@ BI.SortList = BI.inherit(BI.Widget, {
BI.SortList.EVENT_CHANGE = "EVENT_CHANGE"; BI.SortList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.sort_list", BI.SortList); BI.shortcut("bi.sort_list", BI.SortList);
/** /**
* author: young
* createdDate: 2018/12/18
* description:
*/
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
var isMounted = BI.Pane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
this._render();
}
});/**
* 有总页数和总行数的分页控件 * 有总页数和总行数的分页控件
* Created by Young's on 2016/10/13. * Created by Young's on 2016/10/13.
*/ */

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

14
src/base/pane.js

@ -17,20 +17,6 @@ BI.Pane = BI.inherit(BI.Widget, {
}); });
}, },
_init: function () {
BI.Pane.superclass._init.apply(this, arguments);
if (this.__async) {
this.loading();
}
},
_render: function () {
BI.Pane.superclass._render.apply(this, arguments);
if (this.__async) {
this.loaded();
}
},
_assertTip: function () { _assertTip: function () {
var o = this.options; var o = this.options;
if (!this._tipText) { if (!this._tipText) {

31
src/case/loading/loading_pane.js

@ -0,0 +1,31 @@
/**
* author: young
* createdDate: 2018/12/18
* description:
*/
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
var isMounted = BI.Pane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
this._render();
}
});

4
src/core/widget.js

@ -54,6 +54,10 @@
this._initElementHeight(); this._initElementHeight();
this._initVisual(); this._initVisual();
this._initState(); this._initState();
this._initRender();
},
_initRender: function () {
if (this.beforeInit) { if (this.beforeInit) {
this.__asking = true; this.__asking = true;
this.beforeInit(BI.bind(this._render, this)); this.beforeInit(BI.bind(this._render, this));

Loading…
Cancel
Save