From f1f613451c8bb2d36fe487a129999e776b7865c4 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 21 May 2021 18:01:49 +0300 Subject: [PATCH] [SSE] Add show zero option --- .../main/app/controller/ViewTab.js | 5 ++++- .../main/app/template/Toolbar.template | 1 + apps/spreadsheeteditor/main/app/view/ViewTab.js | 13 ++++++++++++- apps/spreadsheeteditor/main/locale/en.json | 3 ++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 80c9e29a4..2cdcb4726 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -87,6 +87,7 @@ define([ 'viewtab:formula': this.onViewSettings, 'viewtab:headings': this.onViewSettings, 'viewtab:gridlines': this.onViewSettings, + 'viewtab:zeros': this.onViewSettings, 'viewtab:zoom': this.onZoom, 'viewtab:showview': this.onShowView, 'viewtab:openview': this.onOpenView, @@ -140,6 +141,7 @@ define([ case 0: this.getApplication().getController('Viewport').header.fireEvent('formulabar:hide', [ value!=='checked']); break; case 1: this.api.asc_setDisplayHeadings(value=='checked'); break; case 2: this.api.asc_setDisplayGridlines( value=='checked'); break; + case 3: this.api.asc_setShowZeros( value=='checked'); break; } } Common.NotificationCenter.trigger('edit:complete', this.view); @@ -196,7 +198,7 @@ define([ onWorksheetLocked: function(index,locked) { if (index == this.api.asc_getActiveWorksheetIndex()) { - Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: [this.view.chHeadings, this.view.chGridlines, this.view.btnFreezePanes]}); + Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: [this.view.chHeadings, this.view.chGridlines, this.view.btnFreezePanes, this.view.chZeros]}); } }, @@ -207,6 +209,7 @@ define([ this.view.chHeadings.setValue(!!params.asc_getShowRowColHeaders(), true); this.view.chGridlines.setValue(!!params.asc_getShowGridLines(), true); this.view.btnFreezePanes.toggle(!!params.asc_getIsFreezePane(), true); + this.view.chZeros.setValue(!!params.asc_getShowZeros(), true); var currentSheet = this.api.asc_getActiveWorksheetIndex(); this.onWorksheetLocked(currentSheet, this.api.asc_isWorksheetLockedOrDeleted(currentSheet)); diff --git a/apps/spreadsheeteditor/main/app/template/Toolbar.template b/apps/spreadsheeteditor/main/app/template/Toolbar.template index d78278a2d..c76a111d3 100644 --- a/apps/spreadsheeteditor/main/app/template/Toolbar.template +++ b/apps/spreadsheeteditor/main/app/template/Toolbar.template @@ -275,6 +275,7 @@
+
diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index e22dcfe16..4ce448f71 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -69,6 +69,9 @@ define([ this.chGridlines.on('change', function (field, value) { me.fireEvent('viewtab:gridlines', [2, value]); }); + this.chZeros.on('change', function (field, value) { + me.fireEvent('viewtab:zeros', [3, value]); + }); this.cmbZoom.on('selected', function(combo, record) { me.fireEvent('viewtab:zoom', [record.value]); }); @@ -172,6 +175,13 @@ define([ }); this.lockedControls.push(this.chGridlines); + this.chZeros = new Common.UI.CheckBox({ + el: $host.findById('#slot-chk-zeros'), + labelText: this.textZeros, + lock : [_set.sheetLock, _set.lostConnect, _set.coAuth] + }); + this.lockedControls.push(this.chZeros); + $host.find('#slot-lbl-zoom').text(this.textZoom); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); @@ -315,7 +325,8 @@ define([ textClose: 'Close', textFormula: 'Formula bar', textHeadings: 'Headings', - textGridlines: 'Gridlines' + textGridlines: 'Gridlines', + textZeros: 'Show zeros' } }()), SSE.Views.ViewTab || {})); }); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 9811ba737..13cb51612 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -3412,5 +3412,6 @@ "SSE.Views.ViewTab.tipClose": "Close sheet view", "SSE.Views.ViewTab.tipCreate": "Create sheet view", "SSE.Views.ViewTab.tipFreeze": "Freeze panes", - "SSE.Views.ViewTab.tipSheetView": "Sheet view" + "SSE.Views.ViewTab.tipSheetView": "Sheet view", + "SSE.Views.ViewTab.textZeros": "Show zeros" } \ No newline at end of file