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) { 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); },