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

View File

@@ -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)
==================

View File

@@ -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/

View File

@@ -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)) {

View File

@@ -55,6 +55,7 @@
{% navigation_resolve_menus names='object,secondary' sort_results=True as action_menus_link_results %}
{% if action_menus_link_results %}
<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">
{% trans 'Actions' %}
<span class="caret"></span>
@@ -106,6 +107,7 @@
{% if facet_menus_link_results %}
<div id="sidebar">
<div class="body-spacer"></div>
<div class="list-group">
{% for menu_link_result in facet_menus_link_results %}
{% for link_group in menu_link_result.link_groups %}

View File

@@ -36,6 +36,7 @@
{% include 'appearance/main_menu.html' %}
</div>
<div class="main">
<div class="body-spacer"></div>
<div class="row zero-margin">
<div class="col-xs-12">
<div id="ajax-content"></div>
@@ -101,6 +102,9 @@
var app = new MayanApp({
ajaxMenusOptions: [
{
callback: function (options) {
options.app.doBodyAdjust();
},
interval: 5000,
menuSelector: '#menu-main',
name: 'menu_main',
@@ -117,11 +121,13 @@
app.resizeFullHeight();
app.setupSelect2();
app.setupScrollView();
}
jQuery(document).ready(function() {
app.initialize();
});
</script>
</body>
</html>