Skip to content

Commit

Permalink
Apply ugly hacky fix for Elementor popup duplicating DA images
Browse files Browse the repository at this point in the history
  • Loading branch information
NatalieMac committed Apr 29, 2023
1 parent 94f756e commit b637262
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion public/assets/js/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
}, 100);

lightboxAnchorLinks(content, target);
window.dispatchEvent(new Event('resize')); // Trigger window resize event for [video] shortcode JS
},
afterOpen: function() {
$('body').on('keyup', documentEsc);
Expand Down Expand Up @@ -786,4 +787,14 @@ window.onerror = function(errorMsg, url, lineNumber) { // This should be a fun l
errorBox.html(contents + '<br/><br/><strong>Error:</strong> ' + errorMsg + '<br/>Line ' + lineNumber + ': ' + url);
}
return false;
}
}

/* Fix for Elementor bug - duplicating DA images when popup opens */
jQuery(document).on('elementor/popup/show', () => {
setTimeout(function(){
var imageContainers = jQuery('.hotspots-image-container');
imageContainers.each(function(){
var extraMapContainers = jQuery(this).find('.hotspots-map-container:not(:first)').remove(); // find all but the first one and remove them
});
}, 250);
} );

0 comments on commit b637262

Please sign in to comment.