PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 3.1.2
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v3.1.2
3.2.2 3.2.3 3.2.1 3.2.0 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.9 trunk 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.3 1.1.4 1.1.5 All 174 releases
master-addons / assets / js / modules / particles.js

particles.js in Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits 3.1.2, at assets/js/modules/particles.js

58 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function(){
2 (function($, elementor) {
3 "use strict";
4 function isElementorEditor() {
5 return typeof elementorFrontend !== "undefined" && elementorFrontend.isEditMode();
6 }
7 var JLTMA_ParticlesBG = function($scope, $2) {
8 if ($scope.hasClass("jltma-particle-yes") || $scope.attr("data-jltma-particle") || $scope.find(".jltma-particle-wrapper").attr("data-jltma-particles-editor")) {
9 let element_type = $scope.data("element_type");
10 let sectionID = encodeURIComponent($scope.data("id"));
11 let particlesJSON;
12 if (!isElementorEditor()) {
13 particlesJSON = $scope.attr("data-jltma-particle");
14 } else {
15 particlesJSON = $scope.find(".jltma-particle-wrapper").attr("data-jltma-particles-editor");
16 }
17 if (("section" === element_type || "column" === element_type || "container" === element_type) && particlesJSON) {
18 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 }
31 } else {
32 if ($scope.hasClass("jltma-particle-yes")) {
33 try {
34 let parsedData = JSON.parse(particlesJSON);
35 particlesJS("jltma-particle-" + sectionID, parsedData);
36 $scope.find(".elementor-column").css("z-index", 9);
37 setTimeout(function() {
38 window.dispatchEvent(new Event("resize"));
39 }, 500);
40 setTimeout(function() {
41 window.dispatchEvent(new Event("resize"));
42 }, 1500);
43 } catch (e) {
44 }
45 } else {
46 $scope.find(".jltma-particle-wrapper").remove();
47 }
48 }
49 }
50 }
51 };
52 $(window).on("elementor/frontend/init", function() {
53 elementorFrontend.hooks.addAction("frontend/element_ready/global", JLTMA_ParticlesBG);
54 elementorFrontend.hooks.addAction("frontend/element_ready/container", JLTMA_ParticlesBG);
55 });
56 })(jQuery, window.elementorFrontend);
57 })();
58