From e5abc42057392994e86a3480bc36f76a3fe1c075 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 23 Aug 2023 22:31:47 +0300 Subject: [PATCH] Fix Bug 63775, refactoring --- apps/common/main/lib/component/BaseView.js | 2 ++ apps/common/main/lib/core/keymaster.js | 3 ++- apps/documenteditor/main/app/controller/DocumentHolder.js | 2 +- apps/presentationeditor/main/app/controller/DocumentHolder.js | 2 +- apps/spreadsheeteditor/main/app/controller/DocumentHolder.js | 2 +- apps/spreadsheeteditor/main/app/controller/Toolbar.js | 4 +++- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/common/main/lib/component/BaseView.js b/apps/common/main/lib/component/BaseView.js index 635faee1d8..4b4c1dbcd4 100644 --- a/apps/common/main/lib/component/BaseView.js +++ b/apps/common/main/lib/component/BaseView.js @@ -65,7 +65,9 @@ define([ PAGEUP: 33, PAGEDOWN: 34, INSERT: 45, + ZERO: 48, EQUALITY_FF:61, + NUM_ZERO: 96, NUM_PLUS: 107, NUM_MINUS: 109, F1: 112, diff --git a/apps/common/main/lib/core/keymaster.js b/apps/common/main/lib/core/keymaster.js index dbf672c20c..b0a77d9309 100644 --- a/apps/common/main/lib/core/keymaster.js +++ b/apps/common/main/lib/core/keymaster.js @@ -31,7 +31,8 @@ ';': 186, '\'': 222, '[': 219, ']': 221, '\\': 220, 'ff-': 173, 'ff=': 61, - numplus: 107, numminus: 109 + numplus: 107, numminus: 109, + '0': 48 }, code = function(x){ return _MAP[x] || x.toUpperCase().charCodeAt(0); diff --git a/apps/documenteditor/main/app/controller/DocumentHolder.js b/apps/documenteditor/main/app/controller/DocumentHolder.js index 34ed4e8c2f..34f505cdf9 100644 --- a/apps/documenteditor/main/app/controller/DocumentHolder.js +++ b/apps/documenteditor/main/app/controller/DocumentHolder.js @@ -707,7 +707,7 @@ define([ event.preventDefault(); event.stopPropagation(); return false; - } else if (key === 48 || key === 96) {// 0 + } else if (key === Common.UI.Keys.ZERO || key === Common.UI.Keys.NUM_ZERO) {// 0 me.api.zoom(100); event.preventDefault(); event.stopPropagation(); diff --git a/apps/presentationeditor/main/app/controller/DocumentHolder.js b/apps/presentationeditor/main/app/controller/DocumentHolder.js index 34de1746af..085dc6869c 100644 --- a/apps/presentationeditor/main/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/main/app/controller/DocumentHolder.js @@ -718,7 +718,7 @@ define([ event.preventDefault(); event.stopPropagation(); return false; - } else if (key === 48 || key === 96) {// 0 + } else if (key === Common.UI.Keys.ZERO || key === Common.UI.Keys.NUM_ZERO) {// 0 me.api.zoomFitToPage(); event.preventDefault(); event.stopPropagation(); diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 7ebb17685d..78e62847b9 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -2390,7 +2390,7 @@ define([ event.stopPropagation(); return false; } - } else if (key === 48 || key === 96) {// 0 + } else if (key === Common.UI.Keys.ZERO || key === Common.UI.Keys.NUM_ZERO) {// 0 if (!this.api.isCellEdited) { this.api.asc_setZoom(1); event.preventDefault(); diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index d8efde8ab7..32fc0d0a0a 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -2100,7 +2100,9 @@ define([ return false; } }; - shortcuts['command+shift+=,ctrl+shift+=,command+shift+numplus,ctrl+shift+numplus' + (Common.Utils.isGecko ? ',command+shift+ff=,ctrl+shift+ff=' : '')] = function(e) { + shortcuts['command+shift+=,ctrl+shift+=,command+shift+numplus,ctrl+shift+numplus' + (Common.Utils.isGecko ? ',command+shift+ff=,ctrl+shift+ff=' : '') + + (Common.Utils.isMac ? ',command+shift+0,ctrl+shift+0' : '')] = function(e) { + if (Common.Utils.isMac && e.keyCode === Common.UI.Keys.ZERO && e.key!=='=') return false; if (me.editMode && !me.toolbar.mode.isEditMailMerge && !me.toolbar.mode.isEditDiagram && !me.toolbar.mode.isEditOle && !me.toolbar.btnAddCell.isDisabled()) { var cellinfo = me.api.asc_getCellInfo(), selectionType = cellinfo.asc_getSelectionType();