Skip to content

Commit

Permalink
update approach based on review's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ludoboludo committed May 6, 2024
1 parent 1d98d3c commit ef0cf34
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions assets/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -1103,10 +1103,9 @@ class VariantSelects extends HTMLElement {
}

updateMedia(html) {
const sectionId = this.dataset.originalSection ? this.dataset.originalSection : this.dataset.section;
const mediaGallerySource = document.querySelector(`[id^="MediaGallery-${this.dataset.section}"] ul`);
const mediaGalleryDestination = html.querySelector(
`[id^="MediaGallery-${this.dataset.section.replace('quickadd-', '')}"] ul`
);
const mediaGalleryDestination = html.querySelector(`[id^="MediaGallery-${sectionId}"] ul`);

const refreshSourceData = () => {
const mediaGallerySourceItems = Array.from(mediaGallerySource.querySelectorAll('li[data-media-id]'));
Expand Down

0 comments on commit ef0cf34

Please sign in to comment.