diff --git a/js/builder.es6.js b/js/builder.es6.js index bb9b60fd2cd5531e3d6d637558d43cb731145385..65bab82e03fed7e78599b5b504c1608d64c3da1f 100644 --- a/js/builder.es6.js +++ b/js/builder.es6.js @@ -472,14 +472,12 @@ attachEventListeners($element, lpbSettings); $element.trigger('lpb-builder:init'); }); - const drake = $element.data('drake'); // Add new containers to the dragula instance. - $element - .find('.js-lpb-region') - .not('.is-dragula-enabled') + $('.js-lpb-region:not(.is-dragula-enabled)', element) .addClass('is-dragula-enabled') .get() .forEach((c) => { + const drake = $(element).data('drake'); drake.containers.push(c); }); }); diff --git a/js/builder.js b/js/builder.js index 399a232718c3f5c806fafc79ad9aea85e1853b53..28bb3783f06b302adff903551225cf064ff475e0 100644 --- a/js/builder.js +++ b/js/builder.js @@ -373,8 +373,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } attachEventListeners($element, lpbSettings); $element.trigger('lpb-builder:init'); }); - var drake = $element.data('drake'); - $element.find('.js-lpb-region').not('.is-dragula-enabled').addClass('is-dragula-enabled').get().forEach(function (c) { + $('.js-lpb-region:not(.is-dragula-enabled)', element).addClass('is-dragula-enabled').get().forEach(function (c) { + var drake = $(element).data('drake'); drake.containers.push(c); }); });