diff --git a/bi/base.js b/bi/base.js index 005c9fea9..1035905ee 100644 --- a/bi/base.js +++ b/bi/base.js @@ -781,7 +781,7 @@ BI.BasicButton = BI.inherit(BI.Single, { }); //之后的300ms点击无效 - var onClick = BI.debounce(this.doClick, BI.EVENT_RESPONSE_TIME, true); + var onClick = BI.debounce(this._doClick, BI.EVENT_RESPONSE_TIME, true); function ev(e) { if (o.stopEvent) { @@ -803,6 +803,11 @@ BI.BasicButton = BI.inherit(BI.Single, { _trigger: function () { var o = this.options; + if (!this.isDisableSelected()) { + this.isForceSelected() ? this.setSelected(true) : + (this.isForceNotSelected() ? this.setSelected(false) : + this.setSelected(!this.isSelected())); + } if (this.isValid()) { o.handler.call(this, this.getValue(), this); var v = this.getValue(); @@ -811,13 +816,15 @@ BI.BasicButton = BI.inherit(BI.Single, { } }, - doClick: function () { - if (!this.isDisableSelected()) { - this.isForceSelected() ? this.setSelected(true) : - (this.isForceNotSelected() ? this.setSelected(false) : - this.setSelected(!this.isSelected())); - } + _doClick: function () { this._trigger(); + if (this.isValid()) { + this.doClick(); + } + }, + + doClick: function () { + }, handle: function () { diff --git a/docs/base.js b/docs/base.js index 005c9fea9..1035905ee 100644 --- a/docs/base.js +++ b/docs/base.js @@ -781,7 +781,7 @@ BI.BasicButton = BI.inherit(BI.Single, { }); //之后的300ms点击无效 - var onClick = BI.debounce(this.doClick, BI.EVENT_RESPONSE_TIME, true); + var onClick = BI.debounce(this._doClick, BI.EVENT_RESPONSE_TIME, true); function ev(e) { if (o.stopEvent) { @@ -803,6 +803,11 @@ BI.BasicButton = BI.inherit(BI.Single, { _trigger: function () { var o = this.options; + if (!this.isDisableSelected()) { + this.isForceSelected() ? this.setSelected(true) : + (this.isForceNotSelected() ? this.setSelected(false) : + this.setSelected(!this.isSelected())); + } if (this.isValid()) { o.handler.call(this, this.getValue(), this); var v = this.getValue(); @@ -811,13 +816,15 @@ BI.BasicButton = BI.inherit(BI.Single, { } }, - doClick: function () { - if (!this.isDisableSelected()) { - this.isForceSelected() ? this.setSelected(true) : - (this.isForceNotSelected() ? this.setSelected(false) : - this.setSelected(!this.isSelected())); - } + _doClick: function () { this._trigger(); + if (this.isValid()) { + this.doClick(); + } + }, + + doClick: function () { + }, handle: function () { diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index 80b513862..8e1079af0 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -198,7 +198,7 @@ BI.BasicButton = BI.inherit(BI.Single, { }); //之后的300ms点击无效 - var onClick = BI.debounce(this.doClick, BI.EVENT_RESPONSE_TIME, true); + var onClick = BI.debounce(this._doClick, BI.EVENT_RESPONSE_TIME, true); function ev(e) { if (o.stopEvent) { @@ -220,6 +220,11 @@ BI.BasicButton = BI.inherit(BI.Single, { _trigger: function () { var o = this.options; + if (!this.isDisableSelected()) { + this.isForceSelected() ? this.setSelected(true) : + (this.isForceNotSelected() ? this.setSelected(false) : + this.setSelected(!this.isSelected())); + } if (this.isValid()) { o.handler.call(this, this.getValue(), this); var v = this.getValue(); @@ -228,13 +233,15 @@ BI.BasicButton = BI.inherit(BI.Single, { } }, - doClick: function () { - if (!this.isDisableSelected()) { - this.isForceSelected() ? this.setSelected(true) : - (this.isForceNotSelected() ? this.setSelected(false) : - this.setSelected(!this.isSelected())); - } + _doClick: function () { this._trigger(); + if (this.isValid()) { + this.doClick(); + } + }, + + doClick: function () { + }, handle: function () {