From ca98097f3cc61135e23b9ab520a0020bb60e6fcc Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Mon, 10 Dec 2012 21:48:39 +0530 Subject: [PATCH] Float the menu bar of the designer --- js/pmd/move.js | 37 ++++++++++++++++++++++++--------- pmd_general.php | 2 +- themes/pmahomme/css/pmd.css.php | 10 +++++++-- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/js/pmd/move.js b/js/pmd/move.js index 92abfc177a..b76c76ee31 100644 --- a/js/pmd/move.js +++ b/js/pmd/move.js @@ -23,9 +23,11 @@ AJAX.registerOnload('pmd/move.js', function() { if ($.FullScreen.supported) { $(document).fullScreenChange(function() { if (! $.FullScreen.isFullScreen()) { - $('#canvas_outer').css({'width': 'auto', 'height': 'auto'}); + $('#page_content').removeClass('content_fullscreen') + .css({'width': 'auto', 'height': 'auto'}); $('#enterFullscreen').show(); $('#exitFullscreen').hide(); + Top_menu_reposition($('#key_Left_Right')[0]); } }); } else { @@ -485,11 +487,14 @@ function Rect(x1, y1, w, h, color) //--------------------------- FULLSCREEN ------------------------------------- function Enter_fullscreen() { - if (! $.FullScreen.isFullScreen()) { - $('#canvas_outer').css({'width': screen.width - 5, 'height': screen.height - 28}); + if (! $.FullScreen.isFullScreen()) { $('#enterFullscreen').hide(); $('#exitFullscreen').show(); - $('#page_content').requestFullScreen(); + $('#page_content') + .addClass('content_fullscreen') + .css({'width': screen.width - 5, 'height': screen.height - 5}) + .requestFullScreen(); + Top_menu_reposition($('#key_Left_Right')[0]); } } @@ -983,12 +988,7 @@ function Show_left_menu(id_this) // max/min all tables function Top_menu_right(id_this) { if (id_this.alt == ">") { - var top_menu_width = 10; - $('#top_menu').children().each(function () { - top_menu_width += $(this).outerWidth(true); - }); - var offset = parseInt(document.getElementById('top_menu').offsetWidth - top_menu_width, 10); - document.getElementById('top_menu').style.paddingLeft = offset + 'px'; + moveTopMenuToRight(id_this); id_this.alt = "<"; id_this.src = pmaThemeImage + "pmd/2leftarrow_m.png"; } else { @@ -997,6 +997,23 @@ function Top_menu_right(id_this) id_this.src = pmaThemeImage + "pmd/2rightarrow_m.png"; } } + +function Top_menu_reposition(id_this) +{ + if (id_this.alt == "<") { + moveTopMenuToRight(id_this); + } +} + +function moveTopMenuToRight(id_this) +{ + var top_menu_width = 10; + $('#top_menu').children().each(function () { + top_menu_width += $(this).outerWidth(true); + }); + var offset = parseInt(document.getElementById('canvas_outer').offsetWidth - top_menu_width, 10); + document.getElementById('top_menu').style.paddingLeft = offset + 'px'; +} //------------------------------------------------------------------------------ function Start_display_field() { diff --git a/pmd_general.php b/pmd_general.php index af0e81da78..ae2046c702 100644 --- a/pmd_general.php +++ b/pmd_general.php @@ -240,7 +240,7 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) { left: px; top: px; + echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["Y"] : rand(50, 550); ?>px; visibility: