From 121871d3746a87d3d26c96147dc21f57c76fcb28 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 20 Oct 2020 19:56:21 +0300 Subject: [PATCH] [DE] Apply tof styles --- .../main/app/view/TableOfContentsSettings.js | 36 ++++++++++++------- apps/documenteditor/main/locale/en.json | 3 ++ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/apps/documenteditor/main/app/view/TableOfContentsSettings.js b/apps/documenteditor/main/app/view/TableOfContentsSettings.js index 3fc4a5dd6..4fdd4bb8d 100644 --- a/apps/documenteditor/main/app/view/TableOfContentsSettings.js +++ b/apps/documenteditor/main/app/view/TableOfContentsSettings.js @@ -391,21 +391,30 @@ define([ this.stylesContainer = $('#tableofcontents-from-styles'); } + var arr = (this.type==1) ? [ + { displayValue: this.txtCurrent, value: Asc.c_oAscTOFStylesType.Current }, + { displayValue: this.txtSimple, value: Asc.c_oAscTOFStylesType.Simple }, + { displayValue: this.txtOnline, value: Asc.c_oAscTOFStylesType.Web }, + { displayValue: this.txtClassic, value: Asc.c_oAscTOFStylesType.Classic }, + { displayValue: this.txtDistinctive, value: Asc.c_oAscTOFStylesType.Distinctive }, + { displayValue: this.txtCentered, value: Asc.c_oAscTOFStylesType.Centered }, + { displayValue: this.txtFormal, value: Asc.c_oAscTOFStylesType.Formal } + ] : [ + { displayValue: this.txtCurrent, value: Asc.c_oAscTOCStylesType.Current }, + { displayValue: this.txtSimple, value: Asc.c_oAscTOCStylesType.Simple }, + { displayValue: this.txtOnline, value: Asc.c_oAscTOCStylesType.Web }, + { displayValue: this.txtStandard, value: Asc.c_oAscTOCStylesType.Standard }, + { displayValue: this.txtModern, value: Asc.c_oAscTOCStylesType.Modern }, + { displayValue: this.txtClassic, value: Asc.c_oAscTOCStylesType.Classic } + ]; this.cmbStyles = new Common.UI.ComboBox({ el: $('#tableofcontents-combo-styles'), cls: 'input-group-nr', menuStyle: 'min-width: 95px;', editable: false, - data: [ - { displayValue: this.txtCurrent, value: Asc.c_oAscTOCStylesType.Current }, - { displayValue: this.txtSimple, value: Asc.c_oAscTOCStylesType.Simple }, - { displayValue: this.txtOnline, value: Asc.c_oAscTOCStylesType.Web }, - { displayValue: this.txtStandard, value: Asc.c_oAscTOCStylesType.Standard }, - { displayValue: this.txtModern, value: Asc.c_oAscTOCStylesType.Modern }, - { displayValue: this.txtClassic, value: Asc.c_oAscTOCStylesType.Classic } - ] + data: arr }); - this.cmbStyles.setValue(Asc.c_oAscTOCStylesType.Current); + this.cmbStyles.setValue(this.type==1 ? Asc.c_oAscTOFStylesType.Current : Asc.c_oAscTOCStylesType.Current); this.cmbStyles.on('selected', _.bind(function(combo, record) { if (this.api && !this._noApply) { var properties = (this._originalProps) ? this._originalProps : new Asc.CTableOfContentsPr(); @@ -739,7 +748,7 @@ define([ } else { props.put_Caption(null); var rec = this.cmbTOFStyles.getSelectedRecord(); - rec && props.add_Style(rec.displayValue, 0); + rec && props.add_Style(rec.displayValue); } } else { if (this._needUpdateOutlineLevels) { @@ -817,7 +826,7 @@ define([ var properties = (this._originalProps) ? this._originalProps : new Asc.CTableOfContentsPr(); properties.put_Caption(null); properties.clear_Styles(); - properties.add_Style(record.displayValue, 0); + properties.add_Style(record.displayValue); this.api.SetDrawImagePlaceTableOfFigures('tableofcontents-img', properties); this.scrollerY.update(); } @@ -873,7 +882,10 @@ define([ strFullCaption: 'Include label and number', textEquation: 'Equation', textFigure: 'Figure', - textTable: 'Table' + textTable: 'Table', + txtDistinctive: 'Distinctive', + txtCentered: 'Centered', + txtFormal: 'Formal' }, DE.Views.TableOfContentsSettings || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index bc73cbf79..07cc75df4 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -2191,6 +2191,9 @@ "DE.Views.TableOfContentsSettings.textEquation": "Equation", "DE.Views.TableOfContentsSettings.textFigure": "Figure", "DE.Views.TableOfContentsSettings.textTable": "Table", + "DE.Views.TableOfContentsSettings.txtDistinctive": "Distinctive", + "DE.Views.TableOfContentsSettings.txtCentered": "Centered", + "DE.Views.TableOfContentsSettings.txtFormal": "Formal", "DE.Views.TableSettings.deleteColumnText": "Delete Column", "DE.Views.TableSettings.deleteRowText": "Delete Row", "DE.Views.TableSettings.deleteTableText": "Delete Table",