Skip to content

Commit

Permalink
CLOUDINARY-523 - trial to fix bug on cloudinary mediaGalleryWidget: p…
Browse files Browse the repository at this point in the history
…reselect first thumb and pushing the new swatches to the start of thumbs
  • Loading branch information
arielien committed Sep 15, 2024
1 parent 5de8d23 commit 761125a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions view/frontend/web/js/swatch-renderer-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ define([
if (cldGalleryWidget) {
const loadedAssets = cldGalleryWidget.options.mediaAssets;
const config = cldGalleryWidget.config;
const mediaAssets = this.mergeMediaAssets(loadedAssets, imgsToUpdate);
const mediaAssets = this.mergeMediaAssets(imgsToUpdate, loadedAssets);
const selectIndex = mediaAssets.length - 1;
this.clickThumbnail(0);
cldGalleryWidget.update({
mediaAssets: mediaAssets,
mediaType: 'image'
}).then((e) => {
this.clickThumbnail(selectIndex);
})

});
}
}
}
Expand Down

0 comments on commit 761125a

Please sign in to comment.