diff --git a/apps/spreadsheeteditor/main/app/template/CellSettings.template b/apps/spreadsheeteditor/main/app/template/CellSettings.template index 78fb733e6..94a3e6715 100644 --- a/apps/spreadsheeteditor/main/app/template/CellSettings.template +++ b/apps/spreadsheeteditor/main/app/template/CellSettings.template @@ -109,6 +109,16 @@
+ + + + + + + +
+ + diff --git a/apps/spreadsheeteditor/main/app/view/CellSettings.js b/apps/spreadsheeteditor/main/app/view/CellSettings.js index 325849ad9..a726df8c2 100644 --- a/apps/spreadsheeteditor/main/app/view/CellSettings.js +++ b/apps/spreadsheeteditor/main/app/view/CellSettings.js @@ -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 || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 1e6d0758a..f25b73cca 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -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.",