PageSourceSearch

https://itchetumal.edu.mx/notas/templates/favourite/js/favmobile-menu/favmobile-menu.js

js itchetumal.edu.mx collected 2026-10-02 20:13:53 UTC 3,329 bytes, 121 lines download raw bytes

1/*
2*   name           FavMobile Menu
3*   version        1.1
4*   author         FavThemes
5*   author URL     http://www.favthemes.com
6*   copyright      Copyright (C) 2012-2016 FavThemes.com. All Rights Reserved.
7*   license        Licensed under GNU/GPLv3 (http://www.gnu.org/licenses/gpl-3.0.html)
8*/
9
10document.addEventListener("DOMContentLoaded", function() {
11
12    favprocess_mobile_menu();
13    favprocess_mobile_menu_onclick();
14
15});
16
17function favprocess_mobile_menu_onclick() {
18
19    var cnavbar = document.getElementsByClassName("navbar")[0];
20
21    for (var i = 0; i < cnavbar.getElementsByClassName("deeper parent").length; i++) {
22
23        cnavbar.getElementsByClassName("deeper parent")[i].onclick = function(event) {
24
25            var achild = this.childNodes[0].tagName;
26            var hrefchild = this.getAttribute('href');
27
28            if (achild != "A" || (hrefchild &&  hrefchild == '#')) {
29
30                var cclasses = this.className;
31
32                if (cclasses.search('favmenuopen') == -1) {
33
34                    this.setAttribute("class", cclasses + " favmenuopen");
35                    var cstyle = 'block';
36
37                } else {
38
39                    this.setAttribute("class", cclasses.replace(" favmenuopen",""));
40                    var cstyle = 'none';
41
42                }
43
44                var navchilds = this.getElementsByClassName("nav-child");
45
46                if (typeof navchilds[0] !== "undefined") {
47
48                    navchilds[0].setAttribute("style", "display: "+cstyle+";");
49
50                }
51
52            }
53
54            event.stopPropagation();
55
56        };
57
58    }
59
60}
61
62function favprocess_mobile_menu() {
63
64    var cnavbar = document.getElementsByClassName("navbar")[0];
65
66    var cactiveel = 'none';
67
68    if (typeof cnavbar !== "undefined") {
69
70        if (typeof cnavbar.getElementsByClassName("current active")[0] !== "undefined") {
71
72            cactiveel = cnavbar.getElementsByClassName("current active")[0];
73
74        }
75
76    }
77
78    for (var i = 0; i < cnavbar.getElementsByClassName("nav-child").length; i++) {
79
80        cnavbar.getElementsByClassName("nav-child")[i].setAttribute("style", "display: none;");
81
82    }
83
84    if (cactiveel != 'none') {
85
86        var element = cactiveel;
87        var navchilds = element.getElementsByClassName("nav-child");
88
89        element.setAttribute("style", "display: block;");
90        element.setAttribute("class", element.className + " favmenuopen");
91
92        for (var i = 0; i < navchilds.length; i++) {
93
94            if (navchilds[i].parentNode.className.search('deeper parent') != -1 && navchilds[i].parentNode.className.search('current active') != -1) {
95
96                navchilds[i].setAttribute("style", "display: block;");
97                navchilds[i].setAttribute("class", navchilds[i].className + " favmenuopen");
98
99            }
100
101        }
102
103        while (element.parentNode) {
104
105            if (typeof element.parentNode.className !== "undefined") {
106
107                if (element.parentNode.className.search('moduletable') != -1) {
108                    break;
109                } else {
110                    element = element.parentNode;
111                    element.setAttribute("style", "display: block;");
112                    element.setAttribute("class", element.className + " favmenuopen");
113                }
114
115            }
116
117        }
118
119    }
120
121}

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.