1$(function(){ 2 const $document = $(document); 3 4 initRosturizm(); 5 6 function initRosturizm(){ 7 let $rosturizm = $(".js-footer-aside-widget-rosturizm"), 8 $script = $(document).find(".nbcrs-badgetic-href"); 9 if($rosturizm.length === 1 && $script.length === 1){ 10 $rosturizm.html($script); 11 } 12 } 13 14 $document.on("click", ".js-header-main-right-functional-menu", function(e){ 15 const $popupMenuItems = $(this).find(".js-header-main-right-pop-up-menu-items"); 16 $popupMenuItems.show(); 17 18 $document.one("click", function(event){ 19 if(!$(event.target).closest(".js-header-main-right-pop-up-menu").length){ 20 $popupMenuItems.hide(); 21 } 22 }); 23 e.stopPropagation(); 24 }); 25 26 $document.on("click", ".js-auth-partner-open", function(){ 27 window.location.href = "/partner-cabinet/"; 28 }); 29 30 $("body").on("click", ".tabs_types label span", function() { 31 var datepicker = $("#ui-datepicker-div"); 32 datepicker.hide(); 33 }); 34 35 const fnTooltipOpen = function(oTooltip){ 36 const oContent = oTooltip.querySelector(".vt-tooltip__content"); 37 if(!oContent) return; 38 39 $(".vt-tooltip.is-open").each(function(){ 40 if(this !== oTooltip) this.classList.remove("is-open"); 41 }); 42 43 oTooltip.style.removeProperty("--vt-tooltip-shift"); 44 oTooltip.classList.add("is-open"); 45 46 let iRightLimit = $(window).width(), 47 iLeftLimit = 0; 48 $(oTooltip).parents().each(function(){ 49 if(["hidden", "clip", "scroll", "auto"].includes($(this).css("overflow-x"))){ 50 const oRect = this.getBoundingClientRect(); 51 if(!oRect.width || !oRect.height) return; 52 iRightLimit = Math.min(iRightLimit, oRect.right); 53 iLeftLimit = Math.max(iLeftLimit, oRect.left); 54 } 55 }); 56 57 const oRect = oContent.getBoundingClientRect(), 58 iShift = Math.min(0, Math.max(iRightLimit - oRect.right, iLeftLimit - oRect.left)); 59 if(iShift < 0){ 60 oTooltip.style.setProperty("--vt-tooltip-shift", Math.round(iShift) + "px"); 61 } 62 }; 63 const fnTooltipClose = function(oTooltip){ 64 oTooltip.classList.remove("is-open"); 65 }; 66 const fnIsFocusVisible = function(oElement){ 67 try{ 68 return oElement.matches(":focus-visible"); 69 }catch(e){ 70 return true; 71 } 72 }; 73 let sTooltipPointerType = "mouse"; 74 75 $document.on("pointerdown pointerover", function(e){ 76 sTooltipPointerType = e.originalEvent.pointerType || "mouse"; 77 }); 78 $document.on("pointerdown", function(e){ 79 if($(e.target).closest(".vt-tooltip").length) return; 80 $(".vt-tooltip.is-open").each(function(){ 81 fnTooltipClose(this); 82 }); 83 }); 84 $document.on("mouseenter", ".vt-tooltip", function(){ 85 if(sTooltipPointerType === "mouse") fnTooltipOpen(this); 86 }); 87 $document.on("mouseleave", ".vt-tooltip", function(){ 88 if(sTooltipPointerType === "mouse") fnTooltipClose(this); 89 }); 90 document.addEventListener("click", function(e){ 91 const oButton = e.target.closest ? e.target.closest(".vt-tooltip button") : null; 92 if(!oButton) return; 93 e.preventDefault(); 94 e.stopPropagation(); 95 if(sTooltipPointerType === "mouse") return; 96 const oTooltip = oButton.closest(".vt-tooltip"); 97 if(oTooltip.classList.contains("is-open")){ 98 fnTooltipClose(oTooltip); 99 }else{ 100 fnTooltipOpen(oTooltip); 101 } 102 }, true); 103 $document.on("focusin", ".vt-tooltip button", function(){ 104 if(fnIsFocusVisible(this)) fnTooltipOpen(this.closest(".vt-tooltip")); 105 }); 106 $document.on("focusout", ".vt-tooltip button", function(){ 107 fnTooltipClose(this.closest(".vt-tooltip")); 108 }); 109}) 110 111function unAuthorizedScroll(){ 112 let scrollPosition = localStorage.getItem("scrollPosition"); 113 if(scrollPosition){ 114 $(window).scrollTop(scrollPosition); 115 localStorage.removeItem("scrollPosition"); 116 } 117} 118 119function throttle(func, limit){ 120 let inThrottle; 121 return function(){ 122 if(!inThrottle){ 123 func.apply(this, arguments); 124 inThrottle = true; 125 setTimeout(() => inThrottle = false, limit); 126 } 127 }; 128}
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.