Skip to content

Commit ef57dc3

Browse files
committed
Only enable the start button if the processing succeeded. Closes blueimp#2894
1 parent 2e153fd commit ef57dc3

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

jquery-ui.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<!--
33
/*
4-
* jQuery File Upload Plugin jQuery UI Demo 9.0.0
4+
* jQuery File Upload Plugin jQuery UI Demo 9.0.1
55
* https://github.com/blueimp/jQuery-File-Upload
66
*
77
* Copyright 2013, Sebastian Tschan
@@ -161,7 +161,7 @@ <h3 class="title"></h3>
161161
</td>
162162
<td>
163163
{% if (!i && !o.options.autoUpload) { %}
164-
<button class="start">Start</button>
164+
<button class="start" disabled>Start</button>
165165
{% } %}
166166
{% if (!i) { %}
167167
<button class="cancel">Cancel</button>

js/jquery.fileupload-jquery-ui.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload jQuery UI Plugin 8.7.0
2+
* jQuery File Upload jQuery UI Plugin 8.7.1
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2013, Sebastian Tschan
@@ -27,6 +27,9 @@
2727
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
2828

2929
options: {
30+
processdone: function (e, data) {
31+
data.context.find('.start').button('enable');
32+
},
3033
progress: function (e, data) {
3134
if (data.context) {
3235
data.context.find('.progress').progressbar(
@@ -85,6 +88,11 @@
8588
return node;
8689
},
8790

91+
_startHandler: function (e) {
92+
$(e.currentTarget).button('disable');
93+
this._super(e);
94+
},
95+
8896
_transition: function (node) {
8997
var deferred = $.Deferred();
9098
if (node.hasClass('fade')) {

0 commit comments

Comments
 (0)