Improved top menubar margin fix
This commit is contained in:
parent
dec96eafba
commit
da3d39d599
@ -3612,29 +3612,28 @@ 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'));
|
||||
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'));
|
||||
// Allow the DOM to render, then adjust the padding on the body
|
||||
setTimeout(function () {
|
||||
$('body').css(
|
||||
'padding-top',
|
||||
$('#floating_menubar').outerHeight(true)
|
||||
);
|
||||
$('#topmenu').menuResizer('resize');
|
||||
}
|
||||
});
|
||||
}, 4);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user