mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fix duplicate URL input field in image uploader
closes #6224 - Add .js-button-accept to removeExtras call - Check for .js-url container existence before prepending it - Remove redundant .init() call
This commit is contained in:
parent
b006eda9f0
commit
89b872ab1a
1 changed files with 4 additions and 5 deletions
|
@ -133,7 +133,7 @@ let UploadUi = function ($dropzone, settings) {
|
|||
},
|
||||
|
||||
removeExtras() {
|
||||
$dropzone.find('span.media, div.js-upload-progress, a.image-url, a.image-upload, a.image-webcam, div.js-fail, button.js-fail, a.js-cancel').remove();
|
||||
$dropzone.find('span.media, div.js-upload-progress, a.image-url, a.image-upload, a.image-webcam, div.js-fail, button.js-fail, a.js-cancel, button.js-button-accept').remove();
|
||||
},
|
||||
|
||||
initWithDropzone() {
|
||||
|
@ -164,7 +164,9 @@ let UploadUi = function ($dropzone, settings) {
|
|||
this.initWithDropzone();
|
||||
});
|
||||
|
||||
$dropzone.find('div.description').before($url);
|
||||
if (!$dropzone.find('.js-url')[0]) {
|
||||
$dropzone.find('div.description').before($url);
|
||||
}
|
||||
|
||||
if (settings.editor) {
|
||||
$dropzone.find('div.js-url').append('<button class="btn btn-blue js-button-accept gh-input">Save</button>');
|
||||
|
@ -208,9 +210,6 @@ let UploadUi = function ($dropzone, settings) {
|
|||
$dropzone.find('img.js-upload-target').attr({src: ''});
|
||||
$dropzone.find('div.description').show();
|
||||
$dropzone.trigger('imagecleared');
|
||||
$dropzone.delay(250).animate({opacity: 100}, 1000, () => {
|
||||
this.init();
|
||||
});
|
||||
|
||||
$dropzone.trigger('uploadsuccess', 'http://');
|
||||
this.initWithDropzone();
|
||||
|
|
Loading…
Add table
Reference in a new issue