1 |
brianr |
1.1 |
diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep |
2 |
|
|
--- smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep 2024-03-04 12:24:58.636810151 +0000 |
3 |
|
|
+++ smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep 2024-03-04 12:14:00.000000000 +0000 |
4 |
|
|
@@ -90,6 +90,47 @@ |
5 |
|
|
% } |
6 |
|
|
|
7 |
|
|
%= javascript '/js/sme-dataTable-setup.js' |
8 |
|
|
+ |
9 |
|
|
+%= javascript begin |
10 |
|
|
+//Set menu to initial condition based on localStorage |
11 |
|
|
+$(document).ready(function() { |
12 |
|
|
+ let menunavflag = window.localStorage.getItem('menunav'); |
13 |
|
|
+ if (menunavflag != "false"){ |
14 |
|
|
+ $('#menunav').toggle(true); |
15 |
|
|
+ } else { |
16 |
|
|
+ $('#menunav').toggle(false); |
17 |
|
|
+ } |
18 |
|
|
+ |
19 |
|
|
+ let menuadmflag = window.localStorage.getItem('menuadm'); |
20 |
|
|
+ if (menuadmflag != "false"){ |
21 |
|
|
+ $('#menuadm').toggle(true); |
22 |
|
|
+ } else { |
23 |
|
|
+ $('#menuadm').toggle(false); |
24 |
|
|
+ } |
25 |
|
|
+ |
26 |
|
|
+ let menuuserflag = window.localStorage.getItem('menuuser'); |
27 |
|
|
+ if (menuuserflag != "false"){ |
28 |
|
|
+ $('#menuuser').toggle(true); |
29 |
|
|
+ } else { |
30 |
|
|
+ $('#menuuser').toggle(false); |
31 |
|
|
+ } |
32 |
|
|
+ |
33 |
|
|
+ var sections = document.getElementsByClassName("section-title"); |
34 |
|
|
+ for (var i = 0, len = sections.length; i < len; i++) { |
35 |
|
|
+ var jqObj = $(sections[i]); |
36 |
|
|
+ var $section = jqObj.parent().next('div'); |
37 |
|
|
+ if(!$section.length){ |
38 |
|
|
+ return false; |
39 |
|
|
+ } |
40 |
|
|
+ let localStorageTag = "admSection-"+sections[i].innerHTML; |
41 |
|
|
+ if (window.localStorage.getItem(localStorageTag) != "false"){ |
42 |
|
|
+ $section.toggle(true); |
43 |
|
|
+ } else { |
44 |
|
|
+ $section.toggle(false); |
45 |
|
|
+ } |
46 |
|
|
+ } |
47 |
|
|
+}) |
48 |
|
|
+%end |
49 |
|
|
|
50 |
|
|
</body> |
51 |
|
|
</html> |