| 1 |
(function(){ |
| 2 |
//#region dev/js/modules/free/particles.js |
| 3 |
/** |
| 4 |
* Start particles background extension script |
| 5 |
*/ |
| 6 |
(function($, elementor) { |
| 7 |
"use strict"; |
| 8 |
function isElementorEditor() { |
| 9 |
return typeof elementorFrontend !== "undefined" && elementorFrontend.isEditMode(); |
| 10 |
} |
| 11 |
var JLTMA_ParticlesBG = function($scope, $) { |
| 12 |
if ($scope.hasClass("jltma-particle-yes") || $scope.attr("data-jltma-particle") || $scope.find(".jltma-particle-wrapper").attr("data-jltma-particles-editor")) { |
| 13 |
let element_type = $scope.data("element_type"); |
| 14 |
let sectionID = encodeURIComponent($scope.data("id")); |
| 15 |
let particlesJSON; |
| 16 |
if (!isElementorEditor()) particlesJSON = $scope.attr("data-jltma-particle"); |
| 17 |
else particlesJSON = $scope.find(".jltma-particle-wrapper").attr("data-jltma-particles-editor"); |
| 18 |
if (("section" === element_type || "column" === element_type || "container" === element_type) && particlesJSON) if (!isElementorEditor()) { |
| 19 |
$scope.prepend("<div class=\"jltma-particle-wrapper\" id=\"jltma-particle-" + sectionID + "\"></div>"); |
| 20 |
try { |
| 21 |
let parsedData = JSON.parse(particlesJSON); |
| 22 |
particlesJS("jltma-particle-" + sectionID, parsedData); |
| 23 |
setTimeout(function() { |
| 24 |
window.dispatchEvent(new Event("resize")); |
| 25 |
}, 500); |
| 26 |
setTimeout(function() { |
| 27 |
window.dispatchEvent(new Event("resize")); |
| 28 |
}, 1500); |
| 29 |
} catch (e) {} |
| 30 |
} else if ($scope.hasClass("jltma-particle-yes")) try { |
| 31 |
let parsedData = JSON.parse(particlesJSON); |
| 32 |
particlesJS("jltma-particle-" + sectionID, parsedData); |
| 33 |
$scope.find(".elementor-column").css("z-index", 9); |
| 34 |
setTimeout(function() { |
| 35 |
window.dispatchEvent(new Event("resize")); |
| 36 |
}, 500); |
| 37 |
setTimeout(function() { |
| 38 |
window.dispatchEvent(new Event("resize")); |
| 39 |
}, 1500); |
| 40 |
} catch (e) {} |
| 41 |
else $scope.find(".jltma-particle-wrapper").remove(); |
| 42 |
} |
| 43 |
}; |
| 44 |
$(window).on("elementor/frontend/init", function() { |
| 45 |
elementorFrontend.hooks.addAction("frontend/element_ready/global", JLTMA_ParticlesBG); |
| 46 |
elementorFrontend.hooks.addAction("frontend/element_ready/container", JLTMA_ParticlesBG); |
| 47 |
}); |
| 48 |
})(jQuery, window.elementorFrontend); |
| 49 |
/** |
| 50 |
* End particles background extension script |
| 51 |
*/ |
| 52 |
//#endregion |
| 53 |
})(); |
| 54 |
|