Add double click to submit, addtional form buttons

Rename form template variable 'form_class' to 'form_css_classes'

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-04-24 22:17:57 -04:00
parent 575b2bc61c
commit fcfadb0caa
5 changed files with 42 additions and 10 deletions
@@ -156,6 +156,7 @@ class MayanApp {
this.setupAJAXSpinner();
this.setupAutoSubmit();
this.setupFormHotkeys();
this.setupFullHeightResizing();
this.setupItemsSelector();
this.setupNavbarCollapse();
@@ -195,6 +196,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;