From d4d06075468d581413276014b378091de1111ba1 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 13 Feb 2019 14:08:18 +0300 Subject: [PATCH] [SSE] Fix Bug 40188 --- .../main/app/template/CellSettings.template | 16 ++++++++++ .../main/app/view/CellSettings.js | 29 +++++++++++++++++-- apps/spreadsheeteditor/main/locale/en.json | 2 ++ 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/template/CellSettings.template b/apps/spreadsheeteditor/main/app/template/CellSettings.template index 2a0b70388..f02f4417d 100644 --- a/apps/spreadsheeteditor/main/app/template/CellSettings.template +++ b/apps/spreadsheeteditor/main/app/template/CellSettings.template @@ -44,5 +44,21 @@
+ + +
+ + + + + + + + + + +
+ + \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/CellSettings.js b/apps/spreadsheeteditor/main/app/view/CellSettings.js index 762ef2482..db1ae7593 100644 --- a/apps/spreadsheeteditor/main/app/view/CellSettings.js +++ b/apps/spreadsheeteditor/main/app/view/CellSettings.js @@ -69,7 +69,8 @@ define([ this._state = { BackColor: undefined, - DisabledControls: true + DisabledControls: true, + CellAngle: undefined }; this.lockedControls = []; this._locked = true; @@ -133,6 +134,10 @@ define([ this.BorderType = record.value; }, + onAngleChange: function(field, newValue, oldValue, eOpts) { + this.api && this.api.asc_setCellAngle(field.getNumberValue()); + }, + render: function () { var el = $(this.el); el.html(this.template({ @@ -218,6 +223,18 @@ define([ this.btnBackColor.render( $('#cell-back-color-btn')); this.btnBackColor.setColor('transparent'); this.lockedControls.push(this.btnBackColor); + + this.spnAngle = new Common.UI.MetricSpinner({ + el: $('#cell-spin-angle'), + step: 1, + width: 60, + defaultUnit : "°", + value: '0 °', + maxValue: 90, + minValue: -90 + }); + this.lockedControls.push(this.spnAngle); + this.spnAngle.on('change', _.bind(this.onAngleChange, this)); }, createDelayedElements: function() { @@ -267,6 +284,12 @@ define([ } this._state.BackColor = clr; } + + var value = props.asc_getAngle(); + if ( Math.abs(this._state.CellAngle-value)>0.1 || (this._state.CellAngle===undefined)&&(this._state.CellAngle!==value)) { + this.spnAngle.setValue((value !== null) ? value : '', true); + this._state.CellAngle=value; + } } }, @@ -341,7 +364,9 @@ define([ tipInnerHor: 'Set Horizontal Inner Lines Only', tipOuter: 'Set Outer Border Only', tipDiagU: 'Set Diagonal Up Border', - tipDiagD: 'Set Diagonal Down Border' + tipDiagD: 'Set Diagonal Down Border', + textOrientation: 'Text Orientation', + textAngle: 'Angle' }, 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 1e0686876..91c6b5be6 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1133,6 +1133,8 @@ "SSE.Views.CellSettings.tipOuter": "Set outer border only", "SSE.Views.CellSettings.tipRight": "Set outer right border only", "SSE.Views.CellSettings.tipTop": "Set outer top border only", + "SSE.Views.CellSettings.textOrientation": "Text Orientation", + "SSE.Views.CellSettings.textAngle": "Angle", "SSE.Views.ChartSettings.strLineWeight": "Line Weight", "SSE.Views.ChartSettings.strSparkColor": "Color", "SSE.Views.ChartSettings.strTemplate": "Template",