diff --git a/mayan/apps/appearance/static/appearance/js/mayan_app.js b/mayan/apps/appearance/static/appearance/js/mayan_app.js index 1c386d949f..a4d3ed0790 100644 --- a/mayan/apps/appearance/static/appearance/js/mayan_app.js +++ b/mayan/apps/appearance/static/appearance/js/mayan_app.js @@ -217,6 +217,7 @@ class MayanApp { this.setupAJAXPeriodicWorkers(); this.setupAJAXSpinner(); this.setupAutoSubmit(); + this.setupFormHotkeys(); this.setupFullHeightResizing(); this.setupItemsSelector(); this.setupNavbarCollapse(); @@ -271,6 +272,21 @@ class MayanApp { }); } + setupFormHotkeys () { + $('body').on('keypress', '.form-hotkey-enter', function (e) { + if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { + $(this).find('.btn-hotkey-default').click(); + return false; + } else { + return true; + } + }); + $('body').on('dblclick', '.form-hotkey-double-click', function (e) { + $(this).find('.btn-hotkey-default').click(); + return false; + }); + } + setupFullHeightResizing () { var self = this; diff --git a/mayan/apps/appearance/templates/appearance/generic_form_subtemplate.html b/mayan/apps/appearance/templates/appearance/generic_form_subtemplate.html index 990e207631..2175b885b8 100644 --- a/mayan/apps/appearance/templates/appearance/generic_form_subtemplate.html +++ b/mayan/apps/appearance/templates/appearance/generic_form_subtemplate.html @@ -10,9 +10,9 @@