PageSourceSearch

https://polariswindows.com/js/app.js

js polariswindows.com collected 2026-10-08 05:20:52 UTC 4,402 bytes, 192 lines download raw bytes

1const handleMouseEnter = (e) => {
2  if (!e.target.dataset.expand) {
3    return;
4  }
5
6  navsVisited += 1;
7
8  if (navsVisited === 1) {
9    expandMenu.classList.add("new--expand");
10    menus.forEach((menu) => menu.classList.add("first"));
11    indicator.classList.add("first");
12  } else {
13    expandMenu.classList.remove("new--expand");
14    menus.forEach((menu) => menu.classList.remove("first"));
15    indicator.classList.remove("first");
16  }
17
18  navLinks.forEach((navLink) => {
19    if (navLink === e.target) {
20      navLink.classList.add("hover");
21      currentNav = navLink;
22    } else {
23      navLink.classList.remove("hover");
24    }
25  });
26
27  const navLinkCenter = Math.floor(
28    e.target.offsetLeft + e.target.clientWidth / 2
29  );
30
31  indicator.style.transform = `translateX(${navLinkCenter}px)`;
32  indicator.style.opacity = "1";
33
34  const targetMenu = document.querySelector(`#${e.target.dataset.expand}`);
35  const targetCoords = targetMenu.getBoundingClientRect();
36  const { width: targetWidth, height: targetHeight } = targetCoords;
37
38  expandMenu.style.width = targetWidth + "px";
39  expandMenu.style.height = targetHeight + "px";
40
41  const prevMenu = targetMenu.previousElementSibling;
42
43  targetMenu.classList.remove("prev");
44
45  if (prevMenu) {
46    prevMenu.classList.add("prev");
47  }
48
49  menus.forEach((menu) => {
50    if (menu.id === targetMenu.id) {
51      menu.classList.add("active");
52    } else {
53      menu.classList.remove("active");
54    }
55  });
56
57  expandMenu.classList.add("expand");
58};
59
60const handleMouseLeave = (e) => {
61  if (isMouseOnMenu || e.y > 50) {
62    return;
63  }
64
65  forceInitialState();
66};
67
68const forceInitialState = () => {
69  expandMenu.classList.remove("expand", "active");
70  currentNav.classList.remove("hover");
71  menus.forEach((menu) => menu.removeAttribute("class"));
72  indicator.style.opacity = "0";
73  currentNav = null;
74  navsVisited = 0;
75};
76
77const expandMenu = document.querySelector(".header__expandMenu");
78const menus = expandMenu.querySelectorAll(".menu__container > *");
79const navLinks = document.querySelectorAll(".nav--link");
80const indicator = document.querySelector(".tip");
81let isMouseOnMenu = false;
82let currentNav;
83let navsVisited = 0;
84
85const {
86  height: menuHeight,
87  width: menuWidth,
88} = expandMenu.getBoundingClientRect();
89
90navLinks.forEach((navLink) => {
91  navLink.addEventListener("mouseenter", handleMouseEnter);
92});
93
94expandMenu.addEventListener("mouseenter", () => {
95  if (expandMenu.style.opacity === "1") {
96    isMouseOnMenu = true;
97  }
98});
99
100expandMenu.addEventListener("mouseleave", (e) => {
101  if (e.y > 70) {
102    isMouseOnMenu = false;
103    forceInitialState();
104  }
105});
106
107document
108  .querySelector(".nav__links")
109  .addEventListener("mouseleave", handleMouseLeave);
110
111(function($) {
112
113	"use strict";
114
115	$('[data-toggle="tooltip"]').tooltip()
116
117})(jQuery);
118
119
120
121
122
123
124
125
126
127
128
129
130$(function() {
131    $(window).on("scroll", function() {
132        if($(window).scrollTop() > 50) {
133            $(".header").addClass("active");
134        } else {
135            //remove the background property so it comes transparent again (defined in your css)
136           $(".header").removeClass("active");
137        }
138    });
139});
140
141
142
143
144
145
146
147
148
149
150(function($){
151		$('.dropdown-menu a.dropdown-toggle').on('click', function(e) {
152		  if (!$(this).next().hasClass('show')) {
153			$(this).parents('.dropdown-menu').first().find('.show').removeClass("show");
154		  }
155		  var $subMenu = $(this).next(".dropdown-menu");
156		  $subMenu.toggleClass('show');
157
158		  $(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function(e) {
159			$('.dropdown-submenu .show').removeClass("show");
160		  });
161
162		  return false;
163		});
164	})(jQuery)
165
166
167
168
169
170var prevClick = -1;
171dropPanel = function(t){
172  var acc = document.getElementsByClassName("drop-down");
173
174  for (i = 0; i < acc.length; i++) {  
175    if(acc[i] === t){
176    	t.classList.toggle("active");
177      var panel = t.nextElementSibling;
178      if(prevClick !== i) {
179				panel.style.maxHeight = panel.scrollHeight + "px";
180        prevClick = i;
181      } else {
182      	panel.style.maxHeight = "0px";
183        prevClick = -1;
184      }
185    } else {
186    	acc[i].classList.toggle("active");
187      var panel = acc[i].nextElementSibling;
188      panel.style.maxHeight = "0px";
189    }
190  }
191}
192

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.