diff --git a/apps/spreadsheeteditor/main/app/template/CellSettings.template b/apps/spreadsheeteditor/main/app/template/CellSettings.template index c9bbb14b0..0168b2dec 100644 --- a/apps/spreadsheeteditor/main/app/template/CellSettings.template +++ b/apps/spreadsheeteditor/main/app/template/CellSettings.template @@ -100,10 +100,25 @@ - +
+ + + + + + + +
+ + + + +
+ + \ 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 dd34f3734..d23b4cc0d 100644 --- a/apps/spreadsheeteditor/main/app/view/CellSettings.js +++ b/apps/spreadsheeteditor/main/app/view/CellSettings.js @@ -429,6 +429,22 @@ define([ this.lockedControls.push(this.spnAngle); this.spnAngle.on('change', _.bind(this.onAngleChange, this)); this.spnAngle.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);}); + + this.chWrap = new Common.UI.CheckBox({ + el: $('#cell-checkbox-wrap'), + labelText: this.strWrap, + disabled: this._locked + }); + this.lockedControls.push(this.chWrap); + this.chWrap.on('change', this.onWrapChange.bind(this)); + + this.chShrink = new Common.UI.CheckBox({ + el: $('#cell-checkbox-shrink'), + labelText: this.strShrink, + disabled: this._locked + }); + this.lockedControls.push(this.chShrink); + this.chShrink.on('change', this.onShrinkChange.bind(this)); }, createDelayedElements: function() { @@ -452,6 +468,21 @@ define([ this.spnAngle.setValue((value !== null) ? (value==255 ? 0 : value) : '', true); this._state.CellAngle = value; } + + value = xfs.asc_getWrapText(); + if ( this._state.Wrap!==value ) { + this.chWrap.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true); + this._state.Wrap=value; + } + this.chWrap.setDisabled(xfs.asc_getHorAlign() == AscCommon.align_Justify || this._locked); + + value = xfs.asc_getShrinkToFit(); + if ( this._state.Shrink!==value ) { + this.chShrink.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true); + this._state.Shrink=value; + } + this.chShrink.setDisabled((this.chWrap.getValue()=='checked') || this._locked); + this.fill = xfs.asc_getFill(); if (this.fill) { this.pattern = this.fill.asc_getPatternFill(); @@ -1127,6 +1158,19 @@ define([ Common.NotificationCenter.trigger('edit:complete', this); }, + onWrapChange: function(field, newValue, oldValue, eOpts){ + if (this.api && !this._noApply) + this.api.asc_setCellTextWrap((field.getValue()=='checked')); + this.chShrink.setDisabled((field.getValue()=='checked') || this._locked); + Common.NotificationCenter.trigger('edit:complete', this); + }, + + onShrinkChange: function(field, newValue, oldValue, eOpts){ + if (this.api && !this._noApply) + this.api.asc_setCellTextShrink((field.getValue()=='checked')); + Common.NotificationCenter.trigger('edit:complete', this); + }, + textBorders: 'Border\'s Style', textBorderColor: 'Color', textBackColor: 'Background color', @@ -1156,7 +1200,10 @@ define([ textPattern: 'Pattern', textForeground: 'Foreground color', textBackground: 'Background color', - textGradient: 'Gradient' + textGradient: 'Gradient', + textControl: 'Text Control', + strWrap: 'Wrap text', + strShrink: 'Shrink to fit' }, 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 a9d5cd25c..4ad0e13a5 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1255,6 +1255,9 @@ "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.textControl": "Text Control", + "SSE.Views.CellSettings.strWrap": "Wrap text", + "SSE.Views.CellSettings.strShrink": "Shrink to fit", "SSE.Views.ChartSettings.strLineWeight": "Line Weight", "SSE.Views.ChartSettings.strSparkColor": "Color", "SSE.Views.ChartSettings.strTemplate": "Template",