1jQuery(document).ready(function ($) { 2 3 $(document).on('mouseenter', '.penci-block-mega', function () { 4 var t = $(this), 5 left = 0, 6 right = 0, 7 wappercontent = t.find('.penci-dropdown-menu'), 8 itemoffset = t.offset(), 9 blockcontainer = t.find('.penci-mega-content-container'), 10 blockw = wappercontent.outerWidth(), 11 vw = $(window).width(), 12 cw = t.closest('.container').outerWidth(), 13 rightoff = vw - itemoffset.left - (vw - cw) / 2, 14 pl = parseFloat( t.closest('.penci_container').css('padding-left') ), 15 pr = parseFloat( t.closest('.penci_container').css('padding-right') ), 16 ps = pl || pr ? (pl + pr)/2 : 0, 17 blockid = blockcontainer.data('blockid'); 18 19 20 t.css({'--pcctnspc' : ps + 'px'}) 21 22 if (t.hasClass('penci-megapos-center') && itemoffset.left > blockw / 2 && vw - itemoffset.left - t.outerWidth() > blockw / 2) { 23 left = (blockw / 2 - t.outerWidth() + ps / 2) * -1; 24 right = (blockw / 2 - t.outerWidth() / 2) * -1; 25 } else if (rightoff < blockw) { 26 left = (blockw - rightoff - ps) * -1; 27 right = (vw - itemoffset.left - t.outerWidth() - (vw - cw) / 2) * -1 - ps; 28 } 29 30 if ($('body').hasClass('rtl')) { 31 wappercontent.css({'right': right + 'px'}); 32 } else { 33 wappercontent.css({'left': left + 'px'}); 34 } 35 36 wappercontent.css({'display': 'block'}); 37 38 if (sessionStorage.getItem("penci_megamenu_"+blockid) && blockcontainer.is(':empty') && t.hasClass('ajax-mega-menu') ) { 39 // Restore the contents of the text field 40 blockcontainer.html(sessionStorage.getItem("penci_megamenu_"+blockid)); 41 $(document).trigger('penci-mega-complete'); 42 } else if (blockcontainer.is(':empty') && t.hasClass('ajax-mega-menu')) { 43 $.ajax({ 44 url: penci_megamenu_var.url, 45 data: { 46 'action': 'penci_get_ajax_menu_mega_content', 47 'ids': blockid, 48 'nonce': penci_megamenu_var.nonce 49 }, 50 dataType: 'json', 51 method: 'POST', 52 beforeSend: function (response) { 53 wappercontent.addClass('loading'); 54 }, 55 success: function (response) { 56 if (response.data.status === 'success') { 57 var dataInsert = response.data.data; 58 sessionStorage.setItem("penci_megamenu_"+blockid, dataInsert); 59 blockcontainer.html(dataInsert); 60 $(document).trigger('penci-mega-loaded'); 61 wappercontent.removeClass('loading'); 62 } else { 63 console.log('loading html dropdowns returns wrong data - ', response.data.message); 64 } 65 }, 66 complete: function () { 67 $(document).trigger('penci-mega-complete'); 68 }, 69 error: function () { 70 console.log('loading html dropdowns ajax error'); 71 } 72 }); 73 } 74 }); 75});
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.