diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 4975e0dcd..488da7081 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -323,6 +323,7 @@ define([ toolbar.btnShowHidenChars.on('toggle', _.bind(this.onNonPrintingToggle, this)); toolbar.mnuTablePicker.on('select', _.bind(this.onTablePickerSelect, this)); toolbar.mnuInsertTable.on('item:click', _.bind(this.onInsertTableClick, this)); + toolbar.mnuInsertTable.on('show:after', _.bind(this.onInsertTableShow, this)); toolbar.mnuInsertImage.on('item:click', _.bind(this.onInsertImageClick, this)); toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, this)); toolbar.btnInsertShape.menu.on('hide:after', _.bind(this.onInsertShapeHide, this)); @@ -1525,6 +1526,11 @@ define([ Common.component.Analytics.trackEvent('ToolBar', 'Table'); }, + onInsertTableShow: function(menu) { + var selected = this.api.asc_GetSelectedText(); + menu.items[4].setDisabled(!selected || selected.length<1); + }, + onInsertTableClick: function(menu, item, e) { var me = this; if (item.value === 'custom') { diff --git a/apps/documenteditor/main/app/view/TextToTableDialog.js b/apps/documenteditor/main/app/view/TextToTableDialog.js index 8f6d0153e..a1d69eea2 100644 --- a/apps/documenteditor/main/app/view/TextToTableDialog.js +++ b/apps/documenteditor/main/app/view/TextToTableDialog.js @@ -247,7 +247,7 @@ define([ maxLength: 1, validateOnChange: true, validateOnBlur: false, - value: '-' + value: Common.Utils.InternalSettings.get("de-text-to-table-separator") || '-' }).on ('changing', function(input, newValue) { if (me.props && newValue) { me.props.put_SeparatorType(3, true); @@ -315,6 +315,7 @@ define([ if (this.props) { this.props.put_AutoFitType(this.rbFixed.getValue() ? 1 : (this.rbContents.getValue() ? 2 : 3)); this.rbFixed.getValue() && this.props.put_Fit(Common.Utils.Metric.fnRecalcToMM(this.spnWidth.getNumberValue())); + this.rbOther.getValue() && Common.Utils.InternalSettings.set("de-text-to-table-separator", String.fromCharCode(this.props.get_Separator())); } return this.props;