1/*=================================*/ 2/* Section Parallax 3/*=================================*/ 4var NtParallaxHandler = function ($scope, $) { 5 var target = $scope, 6 sectionId = target.data("id"), 7 settings = false, 8 editMode = elementorFrontend.isEditMode(); 9 10 if (editMode) { 11 settings = generateEditorSettings(sectionId); 12 } 13 14 if (!editMode || !settings) { 15 //return false; 16 } 17 18 if (settings[0] == "yes") { 19 20 generateJarallax(); 21 22 } 23 24 function generateEditorSettings(targetId) { 25 var editorElements = null, 26 sectionData = {}, 27 sectionMultiData = {}, 28 settings = []; 29 30 if (!window.elementor.hasOwnProperty("elements")) { 31 return false; 32 } 33 34 editorElements = window.elementor.elements; 35 36 if (!editorElements.models) { 37 return false; 38 } 39 40 $.each(editorElements.models, function(index, elem) { 41 42 if (targetId == elem.id) { 43 44 sectionData = elem.attributes.settings.attributes; 45 } else if ( elem.id == target.closest(".elementor-top-section").data("id") ) { 46 47 $.each(elem.attributes.elements.models, function(index, col) { 48 $.each(col.attributes.elements.models, function(index,subSec) { 49 sectionData = subSec.attributes.settings.attributes; 50 }); 51 }); 52 } 53 }); 54 55 if (!sectionData.hasOwnProperty("exline_parallax_type") || "" == sectionData["exline_parallax_type"]) { 56 return false; 57 } 58 59 settings.push(sectionData["exline_parallax_switcher"]); // settings[0] 60 settings.push(sectionData["exline_parallax_type"]); // settings[1] 61 settings.push(sectionData["exline_parallax_speed"]); // settings[2] 62 settings.push(sectionData["exline_parallax_bg_size"]); // settings[3] 63 settings.push("yes" == sectionData["exline_parallax_mobile_support"] ? 0 : 1); // settings[4] 64 settings.push("yes" == sectionData["exline_add_parallax_video"] ? 1 : 0); // settings[5] 65 settings.push(sectionData["exline_local_video_format"]); // settings[6] 66 settings.push(sectionData["exline_parallax_video_url"]); // settings[7] 67 settings.push(sectionData["exline_parallax_video_start_time"]); // settings[8] 68 settings.push(sectionData["exline_parallax_video_end_time"]); // settings[9] 69 settings.push(sectionData["exline_parallax_video_volume"]); // settings[10] 70 71 if (0 !== settings.length) { 72 return settings; 73 } 74 75 return false; 76 } 77 78 function responsiveParallax(android, ios) { 79 switch (true || 1) { 80 case android && ios: 81 return /iPad|iPhone|iPod|Android/; 82 break; 83 case android && !ios: 84 return /Android/; 85 break; 86 case !android && ios: 87 return /iPad|iPhone|iPod/; 88 break; 89 case !android && !ios: 90 return null; 91 } 92 } 93 94 function generateJarallax() { 95 //target.removeAttr('style'); 96 var $type = settings[1] ? settings[1] : 'scroll'; 97 var $speed = settings[2] ? settings[2] : '0.4'; 98 var $imgsize = settings[3] ? settings[3] : 'cover'; 99 100 setTimeout(function() { 101 102 target.jarallax({ 103 type : $type, 104 speed : $speed, 105 imgSize : $imgsize, 106 disableParallax : responsiveParallax(1 == settings[4]) 107 }); 108 109 }, 500); 110 } 111} 112 113jQuery(window).on("elementor/frontend/init", function() { 114 elementorFrontend.hooks.addAction('frontend/element_ready/global', NtParallaxHandler); 115});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.