' +
'
' +
(isLocked
- ? '
'
+ ? ''
: '
'
@@ -252,10 +262,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) {
@@ -356,11 +377,20 @@ define([
});
$item.find('.remove-btn').on('click', function() {
+ const removedIndex = me.shortcutsCollection.findIndex(function(record) {
+ return record == item;
+ });
me.shortcutsCollection.remove(item);
if(me.shortcutsCollection.length == 0) {
me.onAddShortcut();
}
- me.$window.find('#shortcuts-list .item input').last().focus();
+
+ let newFocusableIndex = removedIndex < me.shortcutsCollection.length ? removedIndex : removedIndex - 1;
+ if(me.shortcutsCollection.at(newFocusableIndex).get('removeBtn')) {
+ me.shortcutsCollection.at(newFocusableIndex).get('removeBtn').focus();
+ } else {
+ me.getFooterButtons()[0].focus();;
+ }
});
});
this.fixHeight(true);
@@ -378,19 +408,22 @@ define([
this.shortcutsCollection.each(function(item) {
const ascShortcut = item.get('ascShortcut');
const assignedActionNames = [];
- const assignedActions = me._findAssignedActions(ascShortcut, {
+ const assignedItem = me._findAssignedActions(ascShortcut, {
actionType: me.options.action.type,
shortcuts: me.shortcutsCollection.toJSON().slice(0, _.indexOf(me.shortcutsCollection.models, item))
});
const isDefaultShortcut = me._isDefaultShortcut(ascShortcut);
const isDisabled = !isDefaultShortcut &&
- _.some(assignedActions, function(action) { return action.isLocked; });
+ _.some(assignedItem, function(item) {
+ return item.action.isLocked || item.shortcut.ascShortcut.asc_IsLocked();
+ });
isButtonDisabled = isButtonDisabled || isDisabled;
- for (let i = 0; i < assignedActions.length; i++) {
- const action = assignedActions[i];
- if(action.isLocked == isDisabled) {
+ for (let i = 0; i < assignedItem.length; i++) {
+ const action = assignedItem[i].action;
+ const ascShortcut = assignedItem[i].shortcut.ascShortcut;
+ if((action.isLocked || ascShortcut.asc_IsLocked()) == isDisabled) {
assignedActionNames.push('“' + action.name + '”');
}
}
@@ -480,7 +513,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 ec95597098..97114cf059 100644
--- a/apps/common/main/resources/less/shortcuts-dialog.less
+++ b/apps/common/main/resources/less/shortcuts-dialog.less
@@ -68,6 +68,8 @@
border: 1px solid @border-divider;
box-shadow: 0 1px 0 0 @border-divider-ie;
box-shadow: 0 1px 0 0 @border-divider;
+ color: @text-normal-ie;
+ color: @text-normal;
}
.action-keys-item-comma {
display: flex;
@@ -104,6 +106,15 @@
opacity: 1;
}
}
+
+ &.selected {
+ button {
+ :not(:hover).icon {
+ background-position-x: -20px;
+ background-position-x: @button-small-active-icon-offset-x;
+ }
+ }
+ }
}
}
@@ -147,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",
diff --git a/apps/pdfeditor/main/resources/less/filemenu.less b/apps/pdfeditor/main/resources/less/filemenu.less
index 59b69c34d2..73ab020473 100644
--- a/apps/pdfeditor/main/resources/less/filemenu.less
+++ b/apps/pdfeditor/main/resources/less/filemenu.less
@@ -386,20 +386,21 @@
div {
width: 100%;
height: 100%;
+
+ svg {
+ display: none;
+ width: 24px;
+ height: 30px;
+
+ .pixel-ratio__2_5 & {
+ display: block;
+ }
+ }
+
div{
background: ~"url(@{common-image-const-path}/doc-formats/formats.png)";
background-size: 1200px 30px;
- svg {
- display: none;
- width: 24px;
- height: 30px;
-
- .pixel-ratio__2_5 & {
- display: block;
- }
- }
-
&:not(.svg-file-recent) {
.pixel-ratio__1_25 & {
background-image: ~"url(@{common-image-const-path}/doc-formats/formats@1.25x.png)";