mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-15 03:01:37 -05:00
Merge pull request #6353 from kevinkucharczyk/loading-image-switching-tags
Clear images in gh-uploader when navigating between items
This commit is contained in:
commit
5ab0710da3
1 changed files with 6 additions and 5 deletions
|
@ -36,13 +36,14 @@ export default Component.extend({
|
|||
this.$()[0].uploaderUi.reset();
|
||||
}
|
||||
|
||||
// re-init if we receive a new image but the uploader is blank
|
||||
// re-init if we receive a new image
|
||||
// - handles back button navigating from blank image to populated image
|
||||
// - handles navigating between populated images
|
||||
|
||||
if (!isEmpty(newValue) && this.$()) {
|
||||
if (this.$('.js-upload-target').attr('src') === '') {
|
||||
this.$()[0].uploaderUi.reset();
|
||||
this.$()[0].uploaderUi.initWithImage();
|
||||
}
|
||||
this.$('.js-upload-target').attr('src', '');
|
||||
this.$()[0].uploaderUi.reset();
|
||||
this.$()[0].uploaderUi.initWithImage();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue