From 74e1c012059d7c02b0d568be817eff69b99c3d97 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Thu, 24 Mar 2022 17:56:20 +0300 Subject: [PATCH 1/2] [DE PE SSE] Fix shape recents lang --- .../main/lib/component/ComboDataViewShape.js | 33 +++++++++++++++++++ apps/common/main/lib/component/DataView.js | 33 +++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/apps/common/main/lib/component/ComboDataViewShape.js b/apps/common/main/lib/component/ComboDataViewShape.js index f6737f9a4..5de245ba7 100644 --- a/apps/common/main/lib/component/ComboDataViewShape.js +++ b/apps/common/main/lib/component/ComboDataViewShape.js @@ -128,6 +128,39 @@ define([ recents = Common.localStorage.getItem(this.appPrefix + 'recent-shapes'); recents = recents ? JSON.parse(recents) : []; + // check lang + if (recents.length > 0) { + var isTranslated = _.findWhere(groups, {groupName: recents[0].groupName}); + if (!isTranslated) { + for (var r = 0; r < recents.length; r++) { + var type = recents[r].data.shapeType, + record; + for (var g = 0; g < groups.length; g++) { + var store = groups[g].groupStore, + groupName = groups[g].groupName; + for (var i = 0; i < store.length; i++) { + if (store.at(i).get('data').shapeType === type) { + record = store.at(i).toJSON(); + recents[r] = { + data: record.data, + tip: record.tip, + allowSelected: record.allowSelected, + selected: false, + groupName: groupName + }; + break; + } + } + if (record) { + record = undefined; + break; + } + } + } + Common.localStorage.setItem(this.appPrefix + 'recent-shapes', JSON.stringify(recents)); + } + } + if (recents.length < 12) { var count = 12 - recents.length; diff --git a/apps/common/main/lib/component/DataView.js b/apps/common/main/lib/component/DataView.js index 3444a6c88..dc673e9ee 100644 --- a/apps/common/main/lib/component/DataView.js +++ b/apps/common/main/lib/component/DataView.js @@ -1387,6 +1387,39 @@ define([ me.recentShapes = recentArr; + // check lang + if (me.recentShapes.length > 0) { + var isTranslated = _.findWhere(me.groups, {groupName: me.recentShapes[0].groupName}); + if (!isTranslated) { + for (var r = 0; r < me.recentShapes.length; r++) { + var type = me.recentShapes[r].data.shapeType, + record; + for (var g = 0; g < me.groups.length; g++) { + var store = me.groups[g].groupStore, + groupName = me.groups[g].groupName; + for (var i = 0; i < store.length; i++) { + if (store.at(i).get('data').shapeType === type) { + record = store.at(i).toJSON(); + me.recentShapes[r] = { + data: record.data, + tip: record.tip, + allowSelected: record.allowSelected, + selected: false, + groupName: groupName + }; + break; + } + } + if (record) { + record = undefined; + break; + } + } + } + Common.localStorage.setItem(this.appPrefix + 'recent-shapes', JSON.stringify(me.recentShapes)); + } + } + // Add default recent if (me.recentShapes.length < 12) { From 1a4d696ba573b5429968481cbf04c7b894756cc5 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Thu, 24 Mar 2022 20:48:25 +0300 Subject: [PATCH 2/2] [SSE] Fix scroll in print preview when ctrl is pressed --- apps/spreadsheeteditor/main/app/controller/Print.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/spreadsheeteditor/main/app/controller/Print.js b/apps/spreadsheeteditor/main/app/controller/Print.js index e8af354c4..ff0c5c8e0 100644 --- a/apps/spreadsheeteditor/main/app/controller/Print.js +++ b/apps/spreadsheeteditor/main/app/controller/Print.js @@ -644,6 +644,10 @@ define([ }, onPreviewWheel: function (e) { + if (e.ctrlKey) { + e.preventDefault(); + e.stopImmediatePropagation(); + } var forward = (e.deltaY || (e.detail && -e.detail) || e.wheelDelta) < 0; this.onChangePreviewPage(forward); },