1(function($) { 2 'use strict'; 3 // Move header to last wrapper of page section if its added into page section. 4 $('.js-header-shortcode').each(function() { 5 var $this = $(this), 6 $parent_page_section = $this.parents('.mk-page-section'), 7 $parent_row = $this.parents('.js-master-row'), 8 $is_inside = $parent_page_section.attr('id'); 9 if ($is_inside) { 10 $this.detach().appendTo($parent_page_section); 11 } 12 /* Its needed for sub menus to appear */ 13 $parent_page_section.css({ 14 'overflow': 'visible' 15 }); 16 $parent_row.css({ 17 'overflow': 'visible' 18 }); 19 /* Fix: AM-1918 Add z-index to the header shortcode parent element so that menu is visible on responsive screen when menu icon is clicked */ 20 $this.parent().css('z-index', 99999); 21 }); 22})(jQuery); 23(function( $ ) { 24 'use strict'; 25 26 var AjaxModal = function AjaxModal(el) { 27 this.el = el; 28 29 var $this = $(el); 30 var action = $this.data( 'action' ); 31 var id = $this.data( 'id' ); 32 33 this.load(action, id); 34 }; 35 36 AjaxModal.prototype = { 37 // TODO decouple this 38 init: function init(html) { 39 var self = this; 40 41 $('body').append( html ); 42 43 this.cacheElements(); 44 this.bindEvents(); 45 46 this.$modal.addClass( 'is-active' ); 47 48 MK.core.initAll(self.$modal.get(0)); 49 50 // Its used in Woocommerce Product variation script. 51 $( '.variations_form' ).each( function() { 52 $( this ).wc_variation_form().find('.variations select:eq(0)').change(); 53 }); 54 55 MK.utils.scroll.disable(); 56 MK.ui.loader.remove(); 57 MK.utils.eventManager.publish('quickViewOpen'); 58 }, 59 60 cacheElements: function cacheElement() { 61 this.$modal = $('.mk-modal'); 62 this.$slider = this.$modal.find('.mk-slider-holder'); 63 this.$container = this.$modal.find('.mk-modal-container'); 64 this.$closeBtn = this.$modal.find('.js-modal-close'); 65 }, 66 67 bindEvents: function bindEvents() { 68 this.$container.on('click', function(e) { 69 e.stopPropagation(); 70 }); 71 72 this.$closeBtn.on('click', this.handleClose.bind(this)); 73 this.$modal.on('click', this.handleClose.bind(this)); 74 }, 75 76 handleClose: function handleClose(e) { 77 e.preventDefault(); 78 MK.utils.scroll.enable(); 79 this.close(); 80 }, 81 82 close: function close() { 83 this.$modal.remove(); 84 }, 85 86 load: function load(action, id) { 87 $.ajax({ 88 url: MK.core.path.ajaxUrl, 89 data: { 90 action: action, 91 id: id 92 }, 93 success: this.init.bind( this ), 94 error: this.error.bind( this ) 95 }); 96 }, 97 98 error: function error(response) { 99 console.log(response); 100 } 101 }; 102 103 104 var createModal = function createModal(e) { 105 e.preventDefault(); 106 var el = e.currentTarget; 107 MK.ui.loader.add($(el).parents('.product-loop-thumb')); 108 new AjaxModal(el); 109 }; 110 111 112 $( document ).on( 'click', '.js-ajax-modal', createModal ); 113 114 $(window).on('vc_reload', function(){ 115 $('.mk-product-loop').each(function(){ 116 var id = $(this).attr('id'); 117 var el = '#' + id + ' > .products.js-el'; 118 119 // Disable VC frontend component init for products loop. 120 $(el).data('init-Grid', true); 121 122 // Init Grid component on shortcode render. 123 var component = new MK.component[ 'Grid' ]( el ); 124 component.init(); 125 }); 126 }); 127 128})( 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.