Skip to content

Commit b3f17b4

Browse files
committed
changed to also utilize the data attribute when looking up the container
1 parent b6c3d5e commit b3f17b4

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

dist/breinify-recommendations.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,9 +909,14 @@
909909
_handleClick: function (option, $el, event, additionalEventData) {
910910

911911
// search for the container
912-
const $container = $el.closest('.' + Renderer.marker.container);
912+
let $container = $el.closest('.' + Renderer.marker.container);
913913
if ($container.length !== 1) {
914-
return;
914+
915+
// try to find it via the data attribute
916+
$container = $el.closest('[data-' + Renderer.marker.container + '="true"]');
917+
if ($container.length !== 1) {
918+
return;
919+
}
915920
}
916921

917922
const containerData = $container.data(Renderer.marker.data);

0 commit comments

Comments
 (0)