From 1bfdd54e97b4e772a838f26acdd3a39883736492 Mon Sep 17 00:00:00 2001 From: Alexey Koshelev Date: Wed, 12 Nov 2025 16:13:27 +0300 Subject: [PATCH] [common] Add hint for locked shortcut in shortcut edit dialog --- apps/common/main/lib/view/ShortcutsDialog.js | 2 +- .../main/lib/view/ShortcutsEditDialog.js | 26 +++++++++++++------ .../main/resources/less/shortcuts-dialog.less | 7 +++++ apps/documenteditor/main/locale/en.json | 1 + 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/apps/common/main/lib/view/ShortcutsDialog.js b/apps/common/main/lib/view/ShortcutsDialog.js index bcad311326..1fe14c4a56 100644 --- a/apps/common/main/lib/view/ShortcutsDialog.js +++ b/apps/common/main/lib/view/ShortcutsDialog.js @@ -103,7 +103,7 @@ define([ '', '<% if (action.isLocked) { %>', '', '<% } else { %>', '' + ? ' ' : '' @@ -252,10 +250,21 @@ define([ placeHolder : me.txtInputPlaceholder, disabled : isLocked }); - const removeButton = new Common.UI.Button({ - el: $item.find('.remove-btn'), - }); - item.set({ keysInput: keysInput, removeBtn: removeButton }); + + let removeButton; + if(isLocked) { + $item.find('.lock-info-icon').tooltip({ + title: me.txtCantBeEdited, + placement: 'cursor', + zIndex : parseInt(me.$window.css('z-index')) + 10 + }); + } else { + removeButton = new Common.UI.Button({ + el: $item.find('.remove-btn') + }); + } + + item.set({ keysInput: keysInput, removeBtn: removeButton}); const $keysInput = $item.find('.keys-input input'); $keysInput.on('keydown', function(e) { @@ -480,7 +489,8 @@ define([ txtRestoreToDefault: 'Restore to default', txtTypeDesiredShortcut: 'Type desired shortcut', txtRestoreDescription: 'All shortcuts for action “%1” will be restored to deafult.', - txtRestoreContinue: 'Do you want to continue?' + txtRestoreContinue: 'Do you want to continue?', + txtCantBeEdited: 'This shortcut can’t be edited' }, Common.Views.ShortcutsEditDialog || {})) }); \ No newline at end of file diff --git a/apps/common/main/resources/less/shortcuts-dialog.less b/apps/common/main/resources/less/shortcuts-dialog.less index 090284feb0..97114cf059 100644 --- a/apps/common/main/resources/less/shortcuts-dialog.less +++ b/apps/common/main/resources/less/shortcuts-dialog.less @@ -158,6 +158,13 @@ flex: 1; .margin-right(8px); } + + .lock-info-icon { + width: @x-small-btn-icon-size-ie; + width: @x-small-btn-icon-size; + height: @x-small-btn-icon-size-ie; + height: @x-small-btn-icon-size; + } } .item:not(.first) { margin-top: 8px; diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 549bc53fcd..43f1ff0a51 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1197,6 +1197,7 @@ "Common.Views.ShortcutsEditDialog.txtRestoreToDefault": "Restore to default", "Common.Views.ShortcutsEditDialog.txtTitle": "Edit shortcut", "Common.Views.ShortcutsEditDialog.txtTypeDesiredShortcut": "Type desired shortcut", + "Common.Views.ShortcutsEditDialog.txtCantBeEdited": "This shortcut can’t be edited", "Common.Views.SignDialog.textBold": "Bold", "Common.Views.SignDialog.textCertificate": "Certificate", "Common.Views.SignDialog.textChange": "Change",