Add automatic adjustment of HTML body padding
Closes GitLab issue #643. Thanks to Light Templar (@LightTemplar) for the report. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -60,6 +60,13 @@ class MayanApp {
|
||||
}
|
||||
}
|
||||
|
||||
doBodyAdjust () {
|
||||
// Adjust the height of the body-spacer to move content elements
|
||||
// up or down when the navbar changes size.
|
||||
const navbarSize = 60;
|
||||
$('.body-spacer').css('height', $('.navbar').height() - navbarSize);
|
||||
}
|
||||
|
||||
doRefreshAJAXMenu (options) {
|
||||
$.ajax({
|
||||
complete: function() {
|
||||
@@ -72,7 +79,7 @@ class MayanApp {
|
||||
$(options.menuSelector).html(data.html);
|
||||
options.app.ajaxMenuHashes[data.name] = data.hex_hash;
|
||||
if (options.callback !== undefined) {
|
||||
options.callback();
|
||||
options.callback(options);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -156,6 +163,7 @@ class MayanApp {
|
||||
|
||||
this.setupAJAXSpinner();
|
||||
this.setupAutoSubmit();
|
||||
this.setupBodyAdjust();
|
||||
this.setupFormHotkeys();
|
||||
this.setupFullHeightResizing();
|
||||
this.setupItemsSelector();
|
||||
@@ -196,6 +204,14 @@ class MayanApp {
|
||||
});
|
||||
}
|
||||
|
||||
setupBodyAdjust () {
|
||||
var self = this;
|
||||
|
||||
this.window.resize(function() {
|
||||
self.doBodyAdjust();
|
||||
});
|
||||
}
|
||||
|
||||
setupFormHotkeys () {
|
||||
$('body').on('keypress', '.form-hotkey-enter', function (e) {
|
||||
if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
|
||||
|
||||
Reference in New Issue
Block a user