From dec96eafba30d4d22243b3797e94c150f2b4beff Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Fri, 30 Nov 2012 21:17:43 +0000 Subject: [PATCH] Fixed top menubar margin --- js/functions.js | 53 +++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/js/functions.js b/js/functions.js index 7c80510d5d..b104aff7b4 100644 --- a/js/functions.js +++ b/js/functions.js @@ -3537,30 +3537,6 @@ AJAX.registerTeardown('functions.js', function() { AJAX.registerOnload('functions.js', function() { $('input#print').click(printPage); - - /** - * Makes the breadcrumbs and the menu bar float at the top of the viewport - */ - if ($("#floating_menubar").length && $('#PMA_disable_floating_menubar').length == 0) { - var left = $('html').attr('dir') == 'ltr' ? 'left' : 'right'; - $("#floating_menubar") - .css('margin-' + left, $('#pma_navigation').width() + $('#pma_navigation_resizer').width()) - .css(left, 0) - .css({ - 'position': 'fixed', - 'top': 0, - 'width': '100%', - 'z-index': 500 - }) - .append($('#serverinfo')) - .append($('#topmenucontainer')); - $('body').css( - 'padding-top', - $('#floating_menubar').outerHeight(true) - ); - $('#topmenu').menuResizer('resize'); - } - /** * Ajaxification for the "Create View" action */ @@ -3632,6 +3608,35 @@ function PMA_createViewDialog($this) }); } +/** + * Makes the breadcrumbs and the menu bar float at the top of the viewport + */ +$(function () { + // Double queue the event to make sure the page is ready + $(function () { + + if ($("#floating_menubar").length && $('#PMA_disable_floating_menubar').length == 0) { + var left = $('html').attr('dir') == 'ltr' ? 'left' : 'right'; + $("#floating_menubar") + .css('margin-' + left, $('#pma_navigation').width() + $('#pma_navigation_resizer').width()) + .css(left, 0) + .css({ + 'position': 'fixed', + 'top': 0, + 'width': '100%', + 'z-index': 500 + }) + .append($('#serverinfo')) + .append($('#topmenucontainer')); + $('body').css( + 'padding-top', + $('#floating_menubar').outerHeight(true) + ); + $('#topmenu').menuResizer('resize'); + } + }); +}); + /** * Watches checkboxes in a form to set the checkall box accordingly */