0
Fork 0
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:
Kevin Ansfield 2016-01-18 10:13:38 +00:00
commit 5ab0710da3

View file

@ -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();
}
},