mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
disable save button during image uploads
closes #1661 - disables save button at beginning of image upload - enable save button at image upload fail, at image upload and download success and also at dropzone init
This commit is contained in:
parent
75b261cd69
commit
b1d88a9c9a
1 changed files with 4 additions and 1 deletions
|
@ -27,6 +27,7 @@
|
||||||
$dropzone.find('.fileupload-loading').remove();
|
$dropzone.find('.fileupload-loading').remove();
|
||||||
$dropzone.css({"height": "auto"});
|
$dropzone.css({"height": "auto"});
|
||||||
$dropzone.delay(250).animate({opacity: 100}, 1000, function () {
|
$dropzone.delay(250).animate({opacity: 100}, 1000, function () {
|
||||||
|
$('.js-button-accept').prop('disabled', false);
|
||||||
self.init();
|
self.init();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -68,6 +69,7 @@
|
||||||
},
|
},
|
||||||
add: function (e, data) {
|
add: function (e, data) {
|
||||||
/*jslint unparam:true*/
|
/*jslint unparam:true*/
|
||||||
|
$('.js-button-accept').prop('disabled', true);
|
||||||
$dropzone.find('.js-fileupload').removeClass('right');
|
$dropzone.find('.js-fileupload').removeClass('right');
|
||||||
$dropzone.find('.js-url').remove();
|
$dropzone.find('.js-url').remove();
|
||||||
$progress.find('.js-upload-progress-bar').removeClass('fail');
|
$progress.find('.js-upload-progress-bar').removeClass('fail');
|
||||||
|
@ -94,6 +96,7 @@
|
||||||
},
|
},
|
||||||
fail: function (e, data) {
|
fail: function (e, data) {
|
||||||
/*jslint unparam:true*/
|
/*jslint unparam:true*/
|
||||||
|
$('.js-button-accept').prop('disabled', false);
|
||||||
$dropzone.trigger("uploadfailure", [data.result]);
|
$dropzone.trigger("uploadfailure", [data.result]);
|
||||||
$dropzone.find('.js-upload-progress-bar').addClass('fail');
|
$dropzone.find('.js-upload-progress-bar').addClass('fail');
|
||||||
if (data.jqXHR.status === 413) {
|
if (data.jqXHR.status === 413) {
|
||||||
|
@ -229,7 +232,7 @@
|
||||||
// This ensures there is an image we can hook into to display uploaded image
|
// This ensures there is an image we can hook into to display uploaded image
|
||||||
$dropzone.prepend('<img class="js-upload-target" style="display: none" src="" />');
|
$dropzone.prepend('<img class="js-upload-target" style="display: none" src="" />');
|
||||||
}
|
}
|
||||||
|
$('.js-button-accept').prop('disabled', false);
|
||||||
if ($dropzone.find('img.js-upload-target').attr('src') === '') {
|
if ($dropzone.find('img.js-upload-target').attr('src') === '') {
|
||||||
this.initWithDropzone();
|
this.initWithDropzone();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue