PageSourceSearch

https://decortd.ru/bitrix/templates/gvozdevsoft_zavodgs2_s1/lib/flmenu/flmenu.js?17516045313600

js decortd.ru collected 2026-10-08 14:17:49 UTC 3,600 bytes, 111 lines download raw bytes

1var minwidth=769;
2var flgmini=false;
3window.onresize = CheckLis;
4
5jQuery(document).ready(function() {
6	var lastli = "<li id='fllast'><a>. . .</a><ul></ul></li>";
7	jQuery("#flvmenu > ul").append(lastli);
8	jQuery("#flvmenu").prepend("<div class='minmenu'><i class='fa fa-bars'></i><a>&#1052;&#1045;&#1053;&#1070;</a></div>");
9	jQuery("#flvmenu > ul li ul").before("<a class='flarr'></a>");
10	//scrwdth=scrlbarWidth();
11	CheckLis();
12	Setmini();
13});
14
15function CheckLis() {
16	var navw;
17	var lastli;
18	var allw=0;
19	var navItems;
20	var wdoc=window.innerWidth;
21
22	if(wdoc > minwidth) {
23		lastli = jQuery("#fllast").width();
24		var fllastlng = jQuery("#fllast > ul > li").length;
25		if(fllastlng == 0) lastli = 0;
26		navw = jQuery("#flvmenu").width();
27		jQuery('#flvmenu > ul > li').last().before(jQuery("#fllast > ul > li"));
28		jQuery("#flvmenu > ul > li:not(#fllast)").each(function() { allw += this.clientWidth; });
29		navItems = jQuery('#flvmenu > ul > li:not(#fllast)');
30		if(fllastlng == 1 && allw <= navw) lastli = 0;
31
32		while((allw+lastli) > navw) {
33			allw -= navItems.last().width();
34			navItems.last().prependTo('#fllast > ul');
35			navItems.splice(-1,1);
36			if(fllastlng == 0) lastli = jQuery("#fllast").width();
37		}
38		jQuery("#fllast").css("display","none");
39		if(jQuery("#fllast > ul > li").length > 0) jQuery("#fllast").css("display","inline-block");
40		jQuery(".flarr").html("");
41		jQuery('#flvmenu > ul > li ul').css("height","auto");
42		jQuery("#flvmenu > ul").css("display","flex");
43		SetAlignBl(wdoc);
44		if(flgmini) {flgmini = false; CheckLis();}
45	} else {
46		if(!flgmini) {
47			jQuery('#flvmenu > ul > li').last().before(jQuery("#fllast > ul > li"));
48			jQuery("#fllast").css("display","none");
49			jQuery('#flvmenu > ul > li ul').css("height","0").css("right","auto").css("left","auto");
50			jQuery(".flarr").html("<i class='fa fa-plus'></i>");
51			jQuery("#flvmenu > ul").css("display","none");
52			flgmini = true;
53		}
54	}
55}
56
57function Setmini() {
58	jQuery(".flarr").click(function() {
59		var wdoc=document.documentElement.clientWidth;
60		if(minwidth > wdoc) {
61			var par = this.parentElement;
62			var chldul = par.getElementsByTagName('ul')[0];
63			var chght = chldul.style.height; 
64			if(chght == "0px") {
65				jQuery(this).html("<i class='fa fa-minus'></i>");
66				chldul.style.height = "auto";
67			} else {
68				jQuery(this).html("<i class='fa fa-plus'></i>");
69				chldul.style.height = "0px";
70			}
71		}
72	});
73	jQuery(".minmenu").click(function() {
74		var disp = jQuery("#flvmenu > ul").css("display");
75		if(disp == "block") jQuery("#flvmenu > ul").css("display","none");
76			else jQuery("#flvmenu > ul").css("display","flex");
77	});
78}
79function SetAlignBl(wdoc){
80	jQuery("#flvmenu > ul > li > ul").each(
81		function(){
82			jQuery(this).css("left","0");
83			jQuery(this).css("right","auto");
84			var chldel = this.firstElementChild;
85			var chlwth=0;
86			if(chldel != null) chlwth = jQuery(chldel).width();
87			var setel = getLeftSet(this) + chlwth;
88			if(setel > wdoc) {
89				jQuery(this).css("left","auto");
90				jQuery(this).css("right","0");
91			}
92	});
93	jQuery("#flvmenu > ul > li > ul > li > ul").each(
94		function(){
95			jQuery(this).css("left","100%");
96			jQuery(this).css("right","auto");
97			var chldel = this.firstElementChild;
98			var chlwth=0;
99			if(chldel != null) chlwth = jQuery(chldel).width();
100			var setel = getLeftSet(this) + jQuery(this.parentElement).width() + chlwth;
101			if(setel > wdoc) jQuery(this).css("left","-100%");
102	});
103}
104function getLeftSet(elem) {
105    var left=0;
106    while(elem) {
107        left = left + parseFloat(elem.offsetLeft);
108        elem = elem.parentElement;
109    }
110	return Math.round(left);
111}

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.