Skip to content

Commit

Permalink
fixes #15938, allow of button within click handler
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinr authored and dylans committed Oct 7, 2015
1 parent 8bde719 commit 7c88fa3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion form/_BusyButtonMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ return declare("dojox.form._BusyButtonMixin", null, {
// isBusy: Boolean
isBusy: false,

// isCancelled: Boolean
isCancelled: false,

// busyLabel: String
// text while button is busy
busyLabel: "",
Expand Down Expand Up @@ -48,6 +51,7 @@ return declare("dojox.form._BusyButtonMixin", null, {
// summary:
// sets state from idle to busy
this.isBusy = true;
this.isCancelled = false;

// Webkit does not submit the form if the submit button is disabled when
// clicked ( https://bugs.webkit.org/show_bug.cgi?id=14443 ), so disable the button later
Expand All @@ -65,6 +69,7 @@ return declare("dojox.form._BusyButtonMixin", null, {
// summary:
// if no timeout is set or for other reason the user can put the button back
// to being idle
this.isCancelled = true;
if(this._disableHandle) {
this._disableHandle.remove();
}
Expand Down Expand Up @@ -135,7 +140,10 @@ return declare("dojox.form._BusyButtonMixin", null, {
// only do something if button is not busy
if(!this.isBusy){
this.inherited(arguments); // calls onClick()
this.makeBusy();
// If we still aren't cancelled due to click handler...
if (!this.isCancelled) {
this.makeBusy();
}
}
}
});
Expand Down

0 comments on commit 7c88fa3

Please sign in to comment.