From 8e34bc02b3f69927d601044beac073a9ff4e9e64 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 27 Aug 2019 18:59:08 -0400 Subject: [PATCH] Add automatic adjustment of HTML body padding Closes GitLab issue #643. Thanks to Light Templar (@LightTemplar) for the report. Signed-off-by: Roberto Rosario --- HISTORY.rst | 3 +++ docs/releases/3.2.7.rst | 5 +++++ .../static/appearance/js/mayan_app.js | 18 +++++++++++++++++- .../appearance/templates/appearance/base.html | 2 ++ .../appearance/templates/appearance/root.html | 6 ++++++ 5 files changed, 33 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 67dd94f896..8da213fc35 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -27,6 +27,9 @@ for the report. * Rename the MAYAN_USER_GUID environment variable to MAYAN_USER_GID. +* Add automatic adjustment of HTML body on navigation + bar changes. Closes GitLab issue #643. Thanks to + Light Templar (@LightTemplar) for the report. 3.2.6 (2019-07-10) ================== diff --git a/docs/releases/3.2.7.rst b/docs/releases/3.2.7.rst index 7dadb0c199..392a04b688 100644 --- a/docs/releases/3.2.7.rst +++ b/docs/releases/3.2.7.rst @@ -35,6 +35,9 @@ Changes - Rename the MAYAN_USER_GUID environment variable to MAYAN_USER_GID. - Backport individual index rebuild support. +- Add automatic adjustment of HTML body on navigation + bar changes. Closes GitLab issue #643. Thanks to + Light Templar (@LightTemplar) for the report. Removals -------- @@ -127,11 +130,13 @@ Backward incompatible changes Bugs fixed or issues closed --------------------------- +- :gitlab-issue:`643` The "Actions" button won't show up, if window size between 992 and 1248 px - :gitlab-issue:`650` Permission denied when MAYAN_USER_UID and MAYAN_USER_GUID are set - :gitlab-issue:`652` MAYAN_USER_GUID cannot be set to specific values - :gitlab-issue:`654` Internal Server Error, Document Checkout - :gitlab-issue:`655` Index setup tree view shows two times the "enabled" field instead of "Link documents" - :gitlab-issue:`657` Mailer password length restriction is too short - :forum-topic:`1039` Re: /api/documents/{id}/cabinets returns 500 +- :forum-topic:`1050` edit/delete sub-cabinet .. _PyPI: https://pypi.python.org/pypi/mayan-edms/ diff --git a/mayan/apps/appearance/static/appearance/js/mayan_app.js b/mayan/apps/appearance/static/appearance/js/mayan_app.js index 4011ce59ca..fd65b1a6e6 100644 --- a/mayan/apps/appearance/static/appearance/js/mayan_app.js +++ b/mayan/apps/appearance/static/appearance/js/mayan_app.js @@ -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)) { diff --git a/mayan/apps/appearance/templates/appearance/base.html b/mayan/apps/appearance/templates/appearance/base.html index 09228b5fb5..1af9f0358c 100644 --- a/mayan/apps/appearance/templates/appearance/base.html +++ b/mayan/apps/appearance/templates/appearance/base.html @@ -55,6 +55,7 @@ {% navigation_resolve_menus names='object,secondary' sort_results=True as action_menus_link_results %} {% if action_menus_link_results %}