source: binary-improvements/webserver/js/tabs.js@ 245

Last change on this file since 245 was 245, checked in by alloc, 9 years ago

Fixes

File size: 769 bytes
Line 
1function InitializeTabs () {
2 $("#adminmenu > ul > li").addClass ("menu_button");
3 $(".admincontent > div").addClass ("contenttab");
4 $(".menu_button").on ('click.action', null, function (event) {
5 var menuElement = $(this);
6 var linkElement = menuElement.children ("a");
7 var linkName = linkElement.attr ("href");
8
9 $("*").removeClass ("current_tab");
10 menuElement.addClass ("current_tab");
11 $(linkName).addClass ("current_tab");
12 });
13}
14
15function ApplyTabPermissions () {
16 $("#adminmenu .menu_button").each (function () {
17 if ($(this).children ("a").data ("permission")) {
18 var perm = $(this).children ("a").data ("permission");
19 if (HasPermission (perm)) {
20 $(this).addClass ("allowed");
21 }
22 }
23 });
24
25 $("#adminmenu .allowed").first ().click ();
26}
27
Note: See TracBrowser for help on using the repository browser.