Skip to content

EspoCRM – Open Source CRM Application

Fix shortcuts

Yurii4b1d2640d70b
diff --git a/client/src/views/stream/modals/create-post.js b/client/src/views/stream/modals/create-post.js
index bb8f62f446..6ca9aa1dc1 100644
--- a/client/src/views/stream/modals/create-post.js
+++ b/client/src/views/stream/modals/create-post.js
@@ -34,10 +34,6 @@ class CreatePostModalView extends ModalView {
<div class="record no-side-margin">{{{record}}}</div>
`
- shortcutKeys = {
- 'Control+Enter': 'post',
- }
-
setup() {
this.headerText = this.translate('Create Post');
@@ -76,13 +72,22 @@ class CreatePostModalView extends ModalView {
this.wait(false);
});
+
+ this.shortcutKeys = {
+ 'Control+Enter': e => {
+ e.preventDefault();
+ e.stopPropagation();
+
+ this.post();
+ }
+ };
}
/**
- * @return {module:views/record/edit}
+ * @return {import('views/record/edit').default}
*/
getRecordView() {
- return this.getView('record');
+ return /** @type {import('views/record/edit').default} */this.getView('record');
}
post() {
diff --git a/client/src/views/user/modals/select-position.js b/client/src/views/user/modals/select-position.js
index eb4b4687e8..41fcb2a82b 100644
--- a/client/src/views/user/modals/select-position.js
+++ b/client/src/views/user/modals/select-position.js
@@ -37,9 +37,7 @@ export default class UserSelectPositionModalView extends ModalView {
className = 'dialog dialog-record'
- shortcutKeys = {
- 'Control+Enter': 'apply',
- }
+ shortcutKeys = {}
/**
* @param {{
@@ -100,6 +98,13 @@ export default class UserSelectPositionModalView extends ModalView {
});
this.assignView('record', this.recordView, '.record');
+
+ this.shortcutKeys['Control+Enter'] = e => {
+ e.preventDefault();
+ e.stopPropagation();
+
+ this.apply();
+ }
}
/**