[SSE] Add show zero option

This commit is contained in:
Julia Radzhabova 2021-05-21 18:01:49 +03:00
parent 6bc911c9db
commit f1f613451c
4 changed files with 19 additions and 3 deletions

View file

@ -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));

View file

@ -275,6 +275,7 @@
<span class="btn-slot text" id="slot-chk-gridlines"></span>
</div>
<div class="elset">
<span class="btn-slot text" id="slot-chk-zeros"></span>
</div>
</div>
</section>

View file

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

View file

@ -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"
}