From fe7ce01de366afa8ecfd1fafc5e355097eae1197 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 24 Sep 2012 20:14:06 +0200 Subject: [PATCH] switch_menu script und transition --- css/lx-office-erp/menu.css | 14 ++++++++++++-- js/switchmenuframe.js | 24 ++++++++++++++---------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/css/lx-office-erp/menu.css b/css/lx-office-erp/menu.css index d4165c4a3..19f98b20c 100644 --- a/css/lx-office-erp/menu.css +++ b/css/lx-office-erp/menu.css @@ -295,7 +295,18 @@ div#menuv4 li li li li:hover ul each line is a mi (menuitem) and has one mii (menu-item-icon) whcih is ms (menu-spacer) and one mic (menu-item-chunk) indenting is done with the levels s0, s1, s2 */ -#html-menu { float:left; width: 183px; font-size: 8pt; margin-top: 10px; } +#content.html-menu, #html-menu { + transition: margin-left 0.2s, width 0.2s; + -moz-transition: margin-left 0.2s, width 0.2s; + -webkit-transition: margin-left 0.2s, width 0.2s; + -o-transition: margin-left 0.2s, width 0.2s; +} +#content.html-menu { margin-left: 190px; } +#content.html-menu.folded { margin-left: 40px } +#html-menu.folded:hover + #content.html-menu.folded { margin-left: 190px } +#html-menu { float:left; width: 183px; font-size: 8pt; margin-top: 10px; overflow:hidden; } +#html-menu.folded { width: 32px; } +#html-menu.folded:hover { width: 183px; } #html-menu div.mi { margin-top: 4px; margin-bottom: 3px; white-space: nowrap; clear:both; position:relative; } #html-menu div.sm { font-weight: bold } #html-menu img { vertical-align: top; border: 0; } @@ -312,6 +323,5 @@ div#menuv4 li li li li:hover ul #html-menu div.s0 { padding-left: 2px } #html-menu div.s1 { padding-left: 8px } #html-menu div.s2 { padding-left: 16px } -#content.html-menu { margin-left: 190px } body { margin: 0 } diff --git a/js/switchmenuframe.js b/js/switchmenuframe.js index 055a7d91c..27d0736e8 100644 --- a/js/switchmenuframe.js +++ b/js/switchmenuframe.js @@ -1,15 +1,19 @@ -var vSwitch_Menu = 1; -var Frame; -var FrameSize; - +var vSwitch_Menu = 0; function Switch_Menu() { - if (Frame) { - Frame.attr('cols',vSwitch_Menu ? '30,*' : FrameSize); - vSwitch_Menu=!vSwitch_Menu; + vSwitch_Menu=!vSwitch_Menu; + SetMenuFolded(vSwitch_Menu); + $.cookie('html-menu-folded', vSwitch_Menu); +} +function SetMenuFolded(on) { + if (on) { + $('#html-menu').removeClass('folded'); + $('#content').removeClass('folded'); + } else { + $('#html-menu').addClass('folded'); + $('#content').addClass('folded'); } } - $(function(){ - Frame = $(parent.document.getElementById('menuframe')); - FrameSize = Frame.attr('cols'); + vSwitch_Menu = $.cookie('html-menu-folded'); + SetMenuFolded(vSwitch_Menu); }) -- 2.20.1