From de4dcb9107e3cbc9fc80c71149c548e8b32827d9 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 18 Nov 2016 15:36:48 +0300 Subject: [PATCH] [SSE] Added "Freeze Panes" to the toolbar. --- apps/spreadsheeteditor/main/app/controller/Toolbar.js | 8 ++++++++ apps/spreadsheeteditor/main/app/view/Toolbar.js | 10 ++++++++++ apps/spreadsheeteditor/main/locale/cs.json | 1 + apps/spreadsheeteditor/main/locale/de.json | 1 + apps/spreadsheeteditor/main/locale/en.json | 1 + apps/spreadsheeteditor/main/locale/es.json | 1 + apps/spreadsheeteditor/main/locale/fr.json | 1 + apps/spreadsheeteditor/main/locale/it.json | 1 + apps/spreadsheeteditor/main/locale/ja.json | 1 + apps/spreadsheeteditor/main/locale/pt.json | 1 + apps/spreadsheeteditor/main/locale/ru.json | 1 + apps/spreadsheeteditor/main/locale/sl.json | 1 + apps/spreadsheeteditor/main/locale/tr.json | 1 + 13 files changed, 29 insertions(+) diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index c403c8a9b..10f0998a3 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -1137,6 +1137,7 @@ define([ case 'formula': params.formula = item.checked; option = 'sse-hidden-formula'; break; case 'headings': params.headings = item.checked; break; case 'gridlines': params.gridlines = item.checked; break; + case 'freezepanes': params.freezepanes = item.checked; break; } this.hideElements(params); @@ -1473,6 +1474,7 @@ define([ var params = this.api.asc_getSheetViewSettings(); this.toolbar.mnuitemHideHeadings.setChecked(!params.asc_getShowRowColHeaders()); this.toolbar.mnuitemHideGridlines.setChecked(!params.asc_getShowGridLines()); + this.toolbar.mnuitemFreezePanes.setChecked(params.asc_getIsFreezePane()); } }, @@ -1967,6 +1969,12 @@ define([ } } + if (!_.isUndefined(opts.freezepanes)) { + if (this.api) { + this.api.asc_freezePane(); + } + } + Common.NotificationCenter.trigger('edit:complete', this.toolbar); }, diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 3bbf5ec74..cb46ba084 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -908,6 +908,7 @@ define([ isChecked: function () { return this.conf.checked; } }; this.mnuitemHideGridlines = clone(this.mnuitemHideHeadings); + this.mnuitemFreezePanes = clone(this.mnuitemHideHeadings); this.mnuZoom = { options: {value: 100} }; @@ -1323,6 +1324,7 @@ define([ checkable : true, value : 'formula' }), + {caption: '--'}, this.mnuitemHideHeadings = new Common.UI.MenuItem({ caption : this.textHideHeadings, checkable : true, @@ -1336,6 +1338,13 @@ define([ value : 'gridlines' }), {caption: '--'}, + this.mnuitemFreezePanes = new Common.UI.MenuItem({ + caption : this.textFreezePanes, + checkable : true, + checked : this.mnuitemFreezePanes.isChecked(), + value : 'freezepanes' + }), + {caption: '--'}, this.mnuZoom = new Common.UI.MenuItem({ template: _.template([ '