Fixed top menubar margin

This commit is contained in:
Rouslan Placella 2012-11-30 21:17:43 +00:00
parent 398e8bd5d0
commit dec96eafba

View File

@ -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
*/