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
9fda1dc5ba
commit
41a18c9262
@ -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…
Reference in New Issue
Block a user