Browse Source

Pull request #2355: 无JIAR任务 bugfix 绑定事件的地方延迟绑定一下,会有好处

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '48d60340ee94cd5278416dd2ab9f134cd73a393b':
  bugfix 绑定事件的地方延迟绑定一下,会有好处
es6
guy 3 years ago
parent
commit
cdbedf7ff9
  1. 3
      src/base/combination/combo.js
  2. 3
      src/base/combination/expander.js
  3. 3
      src/base/combination/switcher.js
  4. 5
      src/base/single/button/button.basic.js

3
src/base/combination/combo.js

@ -43,7 +43,8 @@
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
this._initCombo(); this._initCombo();
this._initPullDownAction(); // 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this._initPullDownAction.bind(this));
this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) { if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) { if (type === BI.Events.EXPAND) {

3
src/base/combination/expander.js

@ -25,7 +25,8 @@ BI.Expander = BI.inherit(BI.Widget, {
var self = this, o = this.options; var self = this, o = this.options;
this._expanded = !!o.el.open; this._expanded = !!o.el.open;
this._initExpander(); this._initExpander();
this._initPullDownAction(); // 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this._initPullDownAction.bind(this));
this.expander.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { this.expander.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) { if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) { if (type === BI.Events.EXPAND) {

3
src/base/combination/switcher.js

@ -25,7 +25,8 @@ BI.Switcher = BI.inherit(BI.Widget, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
this._initSwitcher(); this._initSwitcher();
this._initPullDownAction(); // 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this._initPullDownAction.bind(this));
this.switcher.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { this.switcher.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) { if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) { if (type === BI.Events.EXPAND) {

5
src/base/single/button/button.basic.js

@ -31,7 +31,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
_init: function () { _init: function () {
BI.BasicButton.superclass._init.apply(this, arguments); BI.BasicButton.superclass._init.apply(this, arguments);
var opts = this.options; var opts = this.options;
if (opts.shadow) { if (opts.shadow) {
this._createShadow(); this._createShadow();
} }
@ -44,7 +44,8 @@ BI.BasicButton = BI.inherit(BI.Single, {
if (this.options.selected === true) { if (this.options.selected === true) {
this.setSelected(true); this.setSelected(true);
} }
this.bindEvent(); // 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this.bindEvent.bind(this));
BI.BasicButton.superclass._initRef.apply(this, arguments); BI.BasicButton.superclass._initRef.apply(this, arguments);
}, },

Loading…
Cancel
Save