1(function ($) { 2 3 const wdtColumnsHandler = function($scope) { 4 const instance = new wdtColumnsHandlerInit($scope); 5 instance.init(); 6 }; 7 8 const wdtColumnsHandlerInit = function($scope) { 9 10 const $self = this, 11 $window = $(window), 12 $columnId = $scope.data('id'), 13 $editMode = Boolean(elementorFrontend.isEditMode()), 14 $activeBreakpoints = elementorFrontend.config.responsive.activeBreakpoints, 15 $isLegacyModeActive = !!$scope.find( '> .elementor-column-wrap' ).length, 16 $deviceMode = elementorFrontend.getCurrentDeviceMode(); 17 18 let $stickySettings = {}, 19 $stickyInstance = null, 20 $stickyInstanceOptions = { 21 topSpacing: 50, 22 bottomSpacing: 50, 23 containerSelector: $isLegacyModeActive ? '.elementor-row' : '.elementor-container', 24 innerWrapperSelector: $isLegacyModeActive ? '.elementor-column-wrap' : '.elementor-widget-wrap', 25 }; 26 27 $self.init = function() { 28 29 if($editMode) { 30 $stickySettings = $self.generateEditorSettings($columnId); 31 if($stickySettings['sticky']) { 32 $scope.addClass('wdt-sticky-column'); 33 } 34 } else { 35 $stickySettings = $scope.data('wdt-settings'); 36 } 37 38 if($stickySettings === undefined || !$stickySettings['sticky']) { 39 return false; 40 } 41 42 if($stickySettings.stickyOn.indexOf($deviceMode) > -1) { 43 44 $stickyInstanceOptions.topSpacing = $stickySettings['topSpacing']; 45 $stickyInstanceOptions.bottomSpacing = $stickySettings['bottomSpacing']; 46 47 $stickyInstance = new StickySidebar($scope[0], $stickyInstanceOptions); 48 49 } 50 51 }; 52 53 $self.generateEditorSettings = function($columnId) { 54 55 let $editorModels = null, 56 $editorSettings = {}; 57 58 if(!window.elementor.hasOwnProperty('elements')) { 59 return false; 60 } 61 62 $editorModels = window.elementor.elements.models; 63 if(!$editorModels) { 64 return false; 65 } 66 67 $.each( $editorModels, function( index, obj ) { 68 $.each( obj.attributes.elements.models, function( index, obj ) { 69 if($columnId == obj.id ) { 70 $editorSettings = obj.attributes.settings.attributes; 71 } 72 }); 73 }); 74 75 return { 76 'sticky': ($editorSettings['wdt_sticky_column'] === 'yes') ? true : false, 77 'topSpacing': $editorSettings['wdt_sticky_top_spacing'] || 50, 78 'bottomSpacing': $editorSettings['wdt_sticky_bottom_spacing'] || 50, 79 'stickyOn': $editorSettings['wdt_sticky_on_devices'] || [ 'desktop', 'tablet'] 80 } 81 82 }; 83 84 }; 85 86 $(window).on('elementor/frontend/init', function () { 87 elementorFrontend.hooks.addAction( 'frontend/element_ready/column', wdtColumnsHandler ); 88 }); 89 90})(jQuery);
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.