Merge pull request #714 from ONLYOFFICE/feature/sse-cell-indent

Feature/sse cell indent
This commit is contained in:
Julia Radzhabova 2021-02-17 10:54:40 +03:00 committed by GitHub
commit b905e53fdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 2 deletions

View file

@ -109,6 +109,16 @@
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<td colspan=2 class="">
<label class="header"><%= scope.textIndent %></label>
</td>
</tr>
<tr>
<td class="padding-large" colspan=2>
<div id="cell-spin-indent" style="display: inline-block;"></div>
</td>
</tr>
<tr>
<td colspan=2 class="padding-small">
<label class="header"><%= scope.textOrientation %></label>

View file

@ -73,6 +73,7 @@ define([
DisabledControls: true,
DisabledFillPanels: false,
CellAngle: undefined,
CellIndent: undefined,
GradFillType: Asc.c_oAscFillGradType.GRAD_LINEAR,
CellColor: 'transparent',
FillType: Asc.c_oAscFill.FILL_TYPE_NOFILL,
@ -147,7 +148,11 @@ define([
},
onAngleChange: function(field, newValue, oldValue, eOpts) {
this.api && this.api.asc_setCellAngle(field.getNumberValue());
this.api && (newValue!==oldValue) && this.api.asc_setCellAngle(field.getNumberValue());
},
onIndentChange: function(field, newValue, oldValue, eOpts) {
this.api && (newValue!==oldValue) && this.api.asc_setCellIndent(field.getNumberValue());
},
render: function () {
@ -429,6 +434,21 @@ define([
});
this.lockedControls.push(this.btnBackColor);
this.spnIndent = new Common.UI.MetricSpinner({
el: $('#cell-spin-indent'),
step: 1,
width: 60,
defaultUnit : "",
value: '0',
allowDecimal: false,
maxValue: 250,
minValue: 0,
disabled: this._locked
});
this.lockedControls.push(this.spnIndent);
this.spnIndent.on('change', _.bind(this.onIndentChange, this));
this.spnIndent.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);});
this.spnAngle = new Common.UI.MetricSpinner({
el: $('#cell-spin-angle'),
step: 1,
@ -518,6 +538,12 @@ define([
this._state.CellAngle = value;
}
value = xfs.asc_getIndent();
if (Math.abs(this._state.CellIndent - value) > 0.1 || (this._state.CellIndent === undefined) && (this._state.CellIndent !== value)) {
this.spnIndent.setValue((value !== null) ? value : '', true);
this._state.CellIndent = value;
}
value = xfs.asc_getWrapText();
if ( this._state.Wrap!==value ) {
this.chWrap.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true);
@ -1319,7 +1345,8 @@ define([
textGradientColor: 'Color',
textPosition: 'Position',
tipAddGradientPoint: 'Add gradient point',
tipRemoveGradientPoint: 'Remove gradient point'
tipRemoveGradientPoint: 'Remove gradient point',
textIndent: 'Indent'
}, SSE.Views.CellSettings || {}));
});

View file

@ -1370,6 +1370,7 @@
"SSE.Views.CellSettings.tipRemoveGradientPoint": "Remove gradient point",
"SSE.Views.CellSettings.tipRight": "Set outer right border only",
"SSE.Views.CellSettings.tipTop": "Set outer top border only",
"SSE.Views.CellSettings.textIndent": "Indent",
"SSE.Views.ChartDataDialog.errorInFormula": "There's an error in formula you entered.",
"SSE.Views.ChartDataDialog.errorInvalidReference": "The reference is not valid. Reference must be to an open worksheet.",
"SSE.Views.ChartDataDialog.errorMaxPoints": "The maximum number of points in series per chart is 4096.",