mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #2132 from SchrodingersGat/esc-forms
Adds setting to close forms using escape key
This commit is contained in:
commit
d3e5bc3141
@ -981,6 +981,13 @@ class InvenTreeUserSetting(BaseInvenTreeSetting):
|
|||||||
'default': True,
|
'default': True,
|
||||||
'validator': bool,
|
'validator': bool,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'FORMS_CLOSE_USING_ESCAPE': {
|
||||||
|
'name': _('Escape Key Closes Forms'),
|
||||||
|
'description': _('Use the escape key to close modal forms'),
|
||||||
|
'default': False,
|
||||||
|
'validator': bool,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
<div class='row'>
|
<div class='row'>
|
||||||
<table class='table table-striped table-condensed'>
|
<table class='table table-striped table-condensed'>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
{% include "InvenTree/settings/setting.html" with key="FORMS_CLOSE_USING_ESCAPE" icon="fa-window-close" user_setting=True %}
|
||||||
{% include "InvenTree/settings/setting.html" with key="PART_SHOW_QUANTITY_IN_FORMS" icon="fa-hashtag" user_setting=True %}
|
{% include "InvenTree/settings/setting.html" with key="PART_SHOW_QUANTITY_IN_FORMS" icon="fa-hashtag" user_setting=True %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -43,7 +43,7 @@ function createNewModal(options={}) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var html = `
|
var html = `
|
||||||
<div class='modal fade modal-fixed-footer modal-primary inventree-modal' role='dialog' id='modal-form-${id}'>
|
<div class='modal fade modal-fixed-footer modal-primary inventree-modal' role='dialog' id='modal-form-${id}' tabindex='-1'>
|
||||||
<div class='modal-dialog'>
|
<div class='modal-dialog'>
|
||||||
<div class='modal-content'>
|
<div class='modal-content'>
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
@ -111,7 +111,7 @@ function createNewModal(options={}) {
|
|||||||
|
|
||||||
$(modal_name).modal({
|
$(modal_name).modal({
|
||||||
backdrop: 'static',
|
backdrop: 'static',
|
||||||
keyboard: false,
|
keyboard: user_settings.FORMS_CLOSE_USING_ESCAPE,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set labels based on supplied options
|
// Set labels based on supplied options
|
||||||
@ -681,7 +681,7 @@ function openModal(options) {
|
|||||||
|
|
||||||
$(modal).modal({
|
$(modal).modal({
|
||||||
backdrop: 'static',
|
backdrop: 'static',
|
||||||
keyboard: false,
|
keyboard: user_settings.FORMS_CLOSE_USING_ESCAPE,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Disable the form
|
// Disable the form
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class='modal fade modal-fixed-footer modal-primary' role='dialog' id='modal-form'>
|
<div class='modal fade modal-fixed-footer modal-primary' role='dialog' id='modal-form' tabindex='-1'>
|
||||||
<div class='modal-dialog'>
|
<div class='modal-dialog'>
|
||||||
<div class='modal-content'>
|
<div class='modal-content'>
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
Loading…
Reference in New Issue
Block a user