fix: update body padding dynamically using MutationObserver

Signed-off-by: ping-yee <611077101@mail.nknu.edu.tw>
This commit is contained in:
ping-yee 2025-04-01 23:36:24 +08:00
parent d67f785ffb
commit 4be01962ff
No known key found for this signature in database
GPG Key ID: C548278C3B604B42

View File

@ -1097,6 +1097,17 @@ Navigation.ResizeHandler = function () {
$('#floating_menubar').outerHeight(true)
);
}, 2);
if (window.MutationObserver) {
var target = document.getElementById('floating_menubar');
if (target) {
var observer = new MutationObserver(function (mutations) {
$('body').css('padding-top', $('#floating_menubar').outerHeight(true));
});
observer.observe(target, { attributes: true, childList: true, subtree: true });
}
}
$('#pma_console')
.css('margin-' + this.left, (pos + resizerWidth) + 'px');
$resizer.css(this.left, pos + 'px');