47 menu = document.getElementById(menuID); |
48 menu = document.getElementById(menuID); |
48 menu.onmousedown = function() { menuClicked = true; } |
49 menu.onmousedown = function() { menuClicked = true; } |
49 menu.onmouseup = function() { setTimeout('menuClicked = false;', 100); } |
50 menu.onmouseup = function() { setTimeout('menuClicked = false;', 100); } |
50 document.onclick = function() { if ( menuClicked ) return false; adminMenuOff(); } |
51 document.onclick = function() { if ( menuClicked ) return false; adminMenuOff(); } |
51 } |
52 } |
|
53 */ |
52 |
54 |
|
55 function admin_expand() |
|
56 { |
|
57 var expander = document.getElementById('sidebar-hide'); |
|
58 var content = document.getElementById('sidebar-show'); |
|
59 var holder = document.getElementById('td-sidebar'); |
|
60 if ( content.style.display == 'table' ) |
|
61 { |
|
62 createCookie('theme_admin_sidebar', 'collapsed', 3650); |
|
63 admin_collapse_real(expander, content, holder); |
|
64 } |
|
65 else |
|
66 { |
|
67 createCookie('theme_admin_sidebar', 'expanded', 3650); |
|
68 admin_expand_real(expander, content, holder); |
|
69 } |
|
70 } |
|
71 |
|
72 function admin_collapse_real(expander, content, holder) |
|
73 { |
|
74 expander.className = 'collapsed'; |
|
75 content.style.display = 'none'; |
|
76 holder.style.width = '0px'; |
|
77 holder.style.paddingRight = '12px'; |
|
78 holder.style.paddingLeft = '0px'; |
|
79 } |
|
80 |
|
81 function admin_expand_real(expander, content, holder) |
|
82 { |
|
83 expander.className = 'expanded'; |
|
84 content.style.display = 'table'; |
|
85 holder.style.width = '230px'; |
|
86 holder.style.paddingLeft = '12px'; |
|
87 holder.style.paddingRight = '0px'; |
|
88 } |
|
89 |
|
90 function expander_set_height() |
|
91 { |
|
92 var expander = document.getElementById('sidebar-hide'); |
|
93 var magic = $('header').Height() + $('pagebar_main').Height(); |
|
94 var height = getHeight(); |
|
95 var exheight = height - magic; |
|
96 expander.style.height = exheight + 'px'; |
|
97 expander.style.top = magic + 'px'; |
|
98 } |
|
99 |
|
100 function expander_onload() |
|
101 { |
|
102 var expander = document.getElementById('sidebar-hide'); |
|
103 var content = document.getElementById('sidebar-show'); |
|
104 var holder = document.getElementById('td-sidebar'); |
|
105 if ( readCookie('theme_admin_sidebar') == 'collapsed' ) |
|
106 { |
|
107 admin_collapse_real(expander, content, holder); |
|
108 } |
|
109 else if ( readCookie('theme_admin_sidebar') == 'expanded' ) |
|
110 { |
|
111 admin_expand_real(expander, content, holder); |
|
112 } |
|
113 } |
|
114 |
|
115 addOnloadHook(expander_set_height); |
|
116 addOnloadHook(expander_onload); |
|
117 window.onresize = expander_set_height; |
|
118 |