mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Clear images in gh-uploader when navigating between items
closes #6198 - clear img src in gh-uploader when navigating to item with image - always reset uploader component when new image is not empty
This commit is contained in:
parent
a5de701058
commit
4e9b815ba2
1 changed files with 6 additions and 5 deletions
|
@ -36,14 +36,15 @@ 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.$('.js-upload-target').attr('src', '');
|
||||
this.$()[0].uploaderUi.reset();
|
||||
this.$()[0].uploaderUi.initWithImage();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
|
|
Loading…
Add table
Reference in a new issue