Browse Source

update 抽出beforeInit相关逻辑,在LoadingPane中重写loading情况下的render逻辑

es6
Young 6 years ago
parent
commit
201d643489
  1. 4
      demo/js/config/demo.pane.js
  2. 43
      dist/bundle.ie.js
  3. 43
      dist/bundle.js
  4. 39
      dist/case.js
  5. 4
      dist/core.js
  6. 4
      dist/demo.js
  7. 43
      dist/fineui.ie.js
  8. 43
      dist/fineui.js
  9. 43
      dist/fineui_without_jquery_polyfill.js
  10. 39
      src/case/loading/loading_pane.js
  11. 4
      src/core/widget.js

4
demo/js/config/demo.pane.js

@ -9,7 +9,7 @@
},
loadedRender: function () {
render: function () {
return {
type: "bi.center_adapt",
items: [{
@ -19,7 +19,7 @@
};
},
reqInitData: function (callback) {
beforeInit: function (callback) {
setTimeout(function () {
callback();
}, 3000);

43
dist/bundle.ie.js vendored

@ -11771,6 +11771,10 @@ if (!_global.BI) {
this._initElementHeight();
this._initVisual();
this._initState();
this._initRender();
},
_initRender: function () {
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
@ -57180,37 +57184,28 @@ BI.shortcut("bi.sort_list", BI.SortList);
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
BI.Pane.superclass._mount.apply(this, arguments);
if (this.isMounted()) {
this.loading();
this.reqInitData(BI.bind(this.__loaded, this));
var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
render: function () {
return {
type: "bi.default"
};
},
/**
* 子类用loadedRender代替原先的render方法
*/
loadedRender: function () {
return {
type: "bi.default"
};
},
reqInitData: function (callback) {
BI.isFunction(callback) && callback();
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
BI.createWidget(this.loadedRender(), {
element: this
}, this);
this._render();
}
});/**
* 有总页数和总行数的分页控件

43
dist/bundle.js vendored

@ -11771,6 +11771,10 @@ if (!_global.BI) {
this._initElementHeight();
this._initVisual();
this._initState();
this._initRender();
},
_initRender: function () {
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
@ -57584,37 +57588,28 @@ BI.shortcut("bi.sort_list", BI.SortList);
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
BI.Pane.superclass._mount.apply(this, arguments);
if (this.isMounted()) {
this.loading();
this.reqInitData(BI.bind(this.__loaded, this));
var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
render: function () {
return {
type: "bi.default"
};
},
/**
* 子类用loadedRender代替原先的render方法
*/
loadedRender: function () {
return {
type: "bi.default"
};
},
reqInitData: function (callback) {
BI.isFunction(callback) && callback();
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
BI.createWidget(this.loadedRender(), {
element: this
}, this);
this._render();
}
});/**
* 有总页数和总行数的分页控件

39
dist/case.js vendored

@ -7982,37 +7982,28 @@ BI.shortcut("bi.sort_list", BI.SortList);
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
BI.Pane.superclass._mount.apply(this, arguments);
if (this.isMounted()) {
this.loading();
this.reqInitData(BI.bind(this.__loaded, this));
var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
render: function () {
return {
type: "bi.default"
};
},
/**
* 子类用loadedRender代替原先的render方法
*/
loadedRender: function () {
return {
type: "bi.default"
};
},
reqInitData: function (callback) {
BI.isFunction(callback) && callback();
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
BI.createWidget(this.loadedRender(), {
element: this
}, this);
this._render();
}
});/**
* 有总页数和总行数的分页控件

4
dist/core.js vendored

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

4
dist/demo.js vendored

@ -3509,7 +3509,7 @@ Demo.COMPONENT_CONFIG = [{
},
loadedRender: function () {
render: function () {
return {
type: "bi.center_adapt",
items: [{
@ -3519,7 +3519,7 @@ Demo.COMPONENT_CONFIG = [{
};
},
reqInitData: function (callback) {
beforeInit: function (callback) {
setTimeout(function () {
callback();
}, 3000);

43
dist/fineui.ie.js vendored

@ -12016,6 +12016,10 @@ if (!_global.BI) {
this._initElementHeight();
this._initVisual();
this._initState();
this._initRender();
},
_initRender: function () {
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
@ -57425,37 +57429,28 @@ BI.shortcut("bi.sort_list", BI.SortList);
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
BI.Pane.superclass._mount.apply(this, arguments);
if (this.isMounted()) {
this.loading();
this.reqInitData(BI.bind(this.__loaded, this));
var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
render: function () {
return {
type: "bi.default"
};
},
/**
* 子类用loadedRender代替原先的render方法
*/
loadedRender: function () {
return {
type: "bi.default"
};
},
reqInitData: function (callback) {
BI.isFunction(callback) && callback();
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
BI.createWidget(this.loadedRender(), {
element: this
}, this);
this._render();
}
});/**
* 有总页数和总行数的分页控件

43
dist/fineui.js vendored

@ -12016,6 +12016,10 @@ if (!_global.BI) {
this._initElementHeight();
this._initVisual();
this._initState();
this._initRender();
},
_initRender: function () {
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
@ -57829,37 +57833,28 @@ BI.shortcut("bi.sort_list", BI.SortList);
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
BI.Pane.superclass._mount.apply(this, arguments);
if (this.isMounted()) {
this.loading();
this.reqInitData(BI.bind(this.__loaded, this));
var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
render: function () {
return {
type: "bi.default"
};
},
/**
* 子类用loadedRender代替原先的render方法
*/
loadedRender: function () {
return {
type: "bi.default"
};
},
reqInitData: function (callback) {
BI.isFunction(callback) && callback();
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
BI.createWidget(this.loadedRender(), {
element: this
}, this);
this._render();
}
});/**
* 有总页数和总行数的分页控件

43
dist/fineui_without_jquery_polyfill.js vendored

@ -11771,6 +11771,10 @@ if (!_global.BI) {
this._initElementHeight();
this._initVisual();
this._initState();
this._initRender();
},
_initRender: function () {
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
@ -40842,37 +40846,28 @@ BI.shortcut("bi.sort_list", BI.SortList);
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
BI.Pane.superclass._mount.apply(this, arguments);
if (this.isMounted()) {
this.loading();
this.reqInitData(BI.bind(this.__loaded, this));
var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
render: function () {
return {
type: "bi.default"
};
},
/**
* 子类用loadedRender代替原先的render方法
*/
loadedRender: function () {
return {
type: "bi.default"
};
},
reqInitData: function (callback) {
BI.isFunction(callback) && callback();
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
BI.createWidget(this.loadedRender(), {
element: this
}, this);
this._render();
}
});/**
* 有总页数和总行数的分页控件

39
src/case/loading/loading_pane.js

@ -8,36 +8,27 @@
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
BI.Pane.superclass._mount.apply(this, arguments);
if (this.isMounted()) {
this.loading();
this.reqInitData(BI.bind(this.__loaded, this));
var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
render: function () {
return {
type: "bi.default"
};
},
/**
* 子类用loadedRender代替原先的render方法
*/
loadedRender: function () {
return {
type: "bi.default"
};
},
reqInitData: function (callback) {
BI.isFunction(callback) && callback();
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
BI.createWidget(this.loadedRender(), {
element: this
}, this);
this._render();
}
});

4
src/core/widget.js

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

Loading…
Cancel
Save