PageSourceSearch

https://info.mors.org/Portals/87/Skins/MORS/siteNavbar/js/MegaMenu.js?cdv=1361

js mors.org collected 2026-09-24 09:41:20 UTC 3,801 bytes, 104 lines download raw bytes

1var paddingRight = 80;
2
3function handleNavigationMenuItemClick(sender, e) {
4    var result = true;
5    try {
6        result = handleMenuItem(this, null);
7    }
8    catch (ex) {
9        console.log(ex.message);
10    }
11    return result;
12}
13
14function setMegaMenuDepthLevelOneItemWrapperToScreenWidth() {
15    try {
16        var ele = $('.MegaMenu');
17
18        var calculatedWidth = ($(window).width() - ele.parent().position().left - paddingRight);
19
20        // $('.MegaMenu .Wrapper-SubMenu[depthlevel="1"]').each(function () { ele.css("max-width", calculatedWidth); ele.hide(); });
21    }
22    catch (ex) {
23        console.log(ex.message);
24    }
25}
26
27var lastItemOpen = null;
28function bindHoverDepth(StartAt) {
29    try {
30        $('a[depthlevel="' + StartAt + '"], span[depthlevel="' + StartAt + '"]').parent().on('mouseover', function (e) {
31            try {
32                e.stopPropagation();
33
34                if (lastItemOpen) { lastItemOpen.find('.expanded').removeClass('expanded').hide(); }
35
36                var classes = $(this).attr('classes');
37                // console.log('Start hover [' + classes + ']');
38
39                var currentDepthLevel = parseInt($(this).attr('depthlevel'));
40                currentDepthLevel++;
41
42                // $('.Reset-MegaMenu').find('.expanded').removeClass('expanded').hide();
43                var workingItem = $(this).find('.Wrapper-SubMenu[depthlevel="' + currentDepthLevel.toString() + '"]');
44
45                workingItem.addClass('expanded').show();
46                workingItem.css('left', '');
47
48                if (workingItem.offset().left < 0) { workingItem.css('left', '0'); }
49                var itemRight = (workingItem.offset().left + workingItem.width());
50                if (itemRight > $(window).width()) {
51                    var newLeft = ($(window).width() - itemRight - paddingRight);
52
53                    workingItem.css('left', newLeft);
54                }
55
56                lastItemOpen = $(this);
57                // console.log('End hover [' + workingItem.position().left + ', ' + (workingItem.parent().position().left + workingItem.width()) + '] window ' + $(window).width());
58
59            } catch (ex) { console.log(ex.message); }
60        });
61    }
62    catch (ex) {
63        console.log(ex.message);
64    }
65}
66
67function bindMouseOutDepth(StartAt) {
68    try {
69        $('a[depthlevel="' + StartAt + '"]').on('mouseout', function (e) {
70            try {
71                var classes = $(this).attr('class');
72                e.stopPropagation();
73                // console.log('Start out [' + classes + ']');
74                var currentDepthLevel = parseInt($(this).attr('depthlevel'));
75                currentDepthLevel++;
76
77                $(this).parent().find('.expanded').removeClass('expanded').hide();
78
79                lastItemOpen = null;
80                // console.log('End out')
81            } catch (ex) { console.log(ex.message); }
82        });
83    }
84    catch (ex) {
85        console.log(ex.message);
86    }
87}
88
89function setUpMegaMenu() {
90    try {
91        setMegaMenuDepthLevelOneItemWrapperToScreenWidth();
92        bindHoverDepth(0);
93        bindMouseOutDepth(1);
94        $('.Wrapper-SubMenu[depthlevel="1"]').hide();
95        $('.mors-header-nav').on('mouseleave', function (e) { $('.MegaMenu > .Wrapper-SubMenu.expanded').fadeOut(); });
96    }
97    catch (ex) {
98        console.log(ex.message);
99    }
100}
101
102$(window).resize(function () { try { setMegaMenuDepthLevelOneItemWrapperToScreenWidth(); } catch (ex) { console.log(ex.message); } });
103//function pageLoad() { try { setUpMegaMenu(); } catch (ex) { console.log(ex.message); } }
104$(document).ready(function () { try { setUpMegaMenu(); } catch (ex) { console.log(ex.message); } });

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.