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:
Roberto Rosario
2019-08-27 18:59:08 -04:00
parent 666c3324e8
commit 8e34bc02b3
5 changed files with 33 additions and 1 deletions
+3
View File
@@ -27,6 +27,9 @@
for the report. for the report.
* Rename the MAYAN_USER_GUID environment variable * Rename the MAYAN_USER_GUID environment variable
to MAYAN_USER_GID. 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) 3.2.6 (2019-07-10)
================== ==================
+5
View File
@@ -35,6 +35,9 @@ Changes
- Rename the MAYAN_USER_GUID environment variable - Rename the MAYAN_USER_GUID environment variable
to MAYAN_USER_GID. to MAYAN_USER_GID.
- Backport individual index rebuild support. - 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 Removals
-------- --------
@@ -127,11 +130,13 @@ Backward incompatible changes
Bugs fixed or issues closed 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:`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:`652` MAYAN_USER_GUID cannot be set to specific values
- :gitlab-issue:`654` Internal Server Error, Document Checkout - :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:`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 - :gitlab-issue:`657` Mailer password length restriction is too short
- :forum-topic:`1039` Re: /api/documents/{id}/cabinets returns 500 - :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/ .. _PyPI: https://pypi.python.org/pypi/mayan-edms/
@@ -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) { doRefreshAJAXMenu (options) {
$.ajax({ $.ajax({
complete: function() { complete: function() {
@@ -72,7 +79,7 @@ class MayanApp {
$(options.menuSelector).html(data.html); $(options.menuSelector).html(data.html);
options.app.ajaxMenuHashes[data.name] = data.hex_hash; options.app.ajaxMenuHashes[data.name] = data.hex_hash;
if (options.callback !== undefined) { if (options.callback !== undefined) {
options.callback(); options.callback(options);
} }
} }
}, },
@@ -156,6 +163,7 @@ class MayanApp {
this.setupAJAXSpinner(); this.setupAJAXSpinner();
this.setupAutoSubmit(); this.setupAutoSubmit();
this.setupBodyAdjust();
this.setupFormHotkeys(); this.setupFormHotkeys();
this.setupFullHeightResizing(); this.setupFullHeightResizing();
this.setupItemsSelector(); this.setupItemsSelector();
@@ -196,6 +204,14 @@ class MayanApp {
}); });
} }
setupBodyAdjust () {
var self = this;
this.window.resize(function() {
self.doBodyAdjust();
});
}
setupFormHotkeys () { setupFormHotkeys () {
$('body').on('keypress', '.form-hotkey-enter', function (e) { $('body').on('keypress', '.form-hotkey-enter', function (e) {
if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
@@ -55,6 +55,7 @@
{% navigation_resolve_menus names='object,secondary' sort_results=True as action_menus_link_results %} {% navigation_resolve_menus names='object,secondary' sort_results=True as action_menus_link_results %}
{% if action_menus_link_results %} {% if action_menus_link_results %}
<div class="pull-right btn-group" id="menu-actions"> <div class="pull-right btn-group" id="menu-actions">
<div class="body-spacer"></div>
<button aria-expanded="true" class="btn btn-danger btn-sm dropdown-toggle" data-toggle="dropdown" type="button"> <button aria-expanded="true" class="btn btn-danger btn-sm dropdown-toggle" data-toggle="dropdown" type="button">
{% trans 'Actions' %} {% trans 'Actions' %}
<span class="caret"></span> <span class="caret"></span>
@@ -106,6 +107,7 @@
{% if facet_menus_link_results %} {% if facet_menus_link_results %}
<div id="sidebar"> <div id="sidebar">
<div class="body-spacer"></div>
<div class="list-group"> <div class="list-group">
{% for menu_link_result in facet_menus_link_results %} {% for menu_link_result in facet_menus_link_results %}
{% for link_group in menu_link_result.link_groups %} {% for link_group in menu_link_result.link_groups %}
@@ -36,6 +36,7 @@
{% include 'appearance/main_menu.html' %} {% include 'appearance/main_menu.html' %}
</div> </div>
<div class="main"> <div class="main">
<div class="body-spacer"></div>
<div class="row zero-margin"> <div class="row zero-margin">
<div class="col-xs-12"> <div class="col-xs-12">
<div id="ajax-content"></div> <div id="ajax-content"></div>
@@ -101,6 +102,9 @@
var app = new MayanApp({ var app = new MayanApp({
ajaxMenusOptions: [ ajaxMenusOptions: [
{ {
callback: function (options) {
options.app.doBodyAdjust();
},
interval: 5000, interval: 5000,
menuSelector: '#menu-main', menuSelector: '#menu-main',
name: 'menu_main', name: 'menu_main',
@@ -117,11 +121,13 @@
app.resizeFullHeight(); app.resizeFullHeight();
app.setupSelect2(); app.setupSelect2();
app.setupScrollView(); app.setupScrollView();
} }
jQuery(document).ready(function() { jQuery(document).ready(function() {
app.initialize(); app.initialize();
}); });
</script> </script>
</body> </body>
</html> </html>