From de8b8159cd3a32c14e61c42a0f51ac87b4173595 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 10 Oct 2022 17:38:02 +0300 Subject: [PATCH] [DE] Add settings for multilevel list --- .../main/app/view/ListSettingsDialog.js | 139 ++++++++++++++++-- 1 file changed, 126 insertions(+), 13 deletions(-) diff --git a/apps/documenteditor/main/app/view/ListSettingsDialog.js b/apps/documenteditor/main/app/view/ListSettingsDialog.js index 6bca1c99e..91898d566 100644 --- a/apps/documenteditor/main/app/view/ListSettingsDialog.js +++ b/apps/documenteditor/main/app/view/ListSettingsDialog.js @@ -67,7 +67,7 @@ define([ _.extend(this.options, { title: this.txtTitle, - height: (this.type==2) ? 376 : 424, + height: (this.type==2) ? 520 : 424, width: (this.type==2) ? 460 : 300 }, options || {}); @@ -76,21 +76,17 @@ define([ '<% if (type == 2) { %>', '', '', - '', - '', - '', '', '', '', - '', @@ -103,6 +99,28 @@ define([ '
', '', '', + '
', + '', '', - '
', - '
', - '', - '
', - '
', + '
', '
', + '', + '
', '
', + '', '', '
', '
', + '', + '', + '', + '', + '', + '', + '', + '
', + '', + '
', + '
', + '', + '
', + '
', + '', + '
', + '
', + '', + '
', + '
', + '', '', '', '', '
', '', @@ -112,7 +130,7 @@ define([ '', '', - '
', + '
', '
', '', @@ -177,6 +195,7 @@ define([ text: '', lvlIndexes: [] }; + this.spinners = []; Common.UI.Window.prototype.initialize.call(this, this.options); }, @@ -413,6 +432,7 @@ define([ this.cmbLevel = new Common.UI.ComboBox({ el : $window.find('#id-dlg-numbering-format-lvl'), menuStyle : 'min-width: 100%;', + style : "width: 130px;", editable : false, cls : 'input-group-nr', data : [], @@ -423,7 +443,7 @@ define([ this.spnStart = new Common.UI.MetricSpinner({ el: $window.find('#id-dlg-numbering-spin-start'), step: 1, - width: 45, + width: 85, defaultUnit : "", value: 1, maxValue: 16383, @@ -470,6 +490,76 @@ define([ }); this.btnItalic.on('click', _.bind(this.onItalicClick, this)); + this.spnAlign = new Common.UI.MetricSpinner({ + el: $window.findById('#id-dlg-numbering-align-at'), + step: .1, + width: 85, + defaultUnit : "cm", + defaultValue : 0, + value: '0 cm', + maxValue: 55.87, + minValue: 0 + }); + this.spinners.push(this.spnAlign); + this.spnAlign.on('change', _.bind(function(field, newValue, oldValue, eOpts){ + if (this._changedProps) { + this._changedProps.put_NumberPosition(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue())); + } + if (this.api) { + this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this.props, this.level, this.type==2); + } + }, this)); + + this.spnIndents = new Common.UI.MetricSpinner({ + el: $window.findById('#id-dlg-numbering-indent'), + step: .1, + width: 85, + defaultUnit : "cm", + defaultValue : 0, + value: '0 cm', + maxValue: 55.87, + minValue: 0 + }); + this.spinners.push(this.spnIndents); + this.spnIndents.on('change', _.bind(function(field, newValue, oldValue, eOpts){ + if (this._changedProps) { + this._changedProps.put_IndentSize(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue())); + } + if (this.api) { + this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this.props, this.level, this.type==2); + } + }, this)); + + this.cmbFollow = new Common.UI.ComboBox({ + el : $window.find('#id-dlg-numbering-follow'), + menuStyle : 'min-width: 100%;', + editable : false, + cls : 'input-group-nr', + data : [ + { value: Asc.c_oAscNumberingSuff.Tab, displayValue: this.textTab }, + { value: Asc.c_oAscNumberingSuff.Space, displayValue: this.textSpace }, + { value: Asc.c_oAscNumberingSuff.None, displayValue: this.txtNone } + ], + takeFocusOnClose: true + }); + this.cmbFollow.on('selected', _.bind(function (combo, record) { + if (this._changedProps) + this._changedProps.put_Suff(record.value); + if (this.api) { + this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this.props, this.level, this.type==2); + } + }, this)); + + this.chRestart = new Common.UI.CheckBox({ + el: $window.find('#id-dlg-numbering-restart'), + labelText: this.txtRestart + }); + this.chRestart.on('change', _.bind(function(field, newValue, oldValue, eOpts){ + if (this._changedProps) { + this._changedProps.put_Restart(field.getValue()=='checked' ? -1 : 0); + } + }, this)); + this.on('animate:after', _.bind(this.onAnimateAfter, this)); this.afterRender(); @@ -493,6 +583,7 @@ define([ this.cmbFonts.fillFonts(this.fontStore); this.cmbFonts.selectRecord(this.fontStore.findWhere({name: this.fontName})); + this.updateMetricUnit(); this.updateThemeColors(); this._setDefaults(this.props); var me = this; @@ -505,6 +596,16 @@ define([ }); }, + updateMetricUnit: function() { + if (this.spinners) { + for (var i=0; i0) { if (format == Asc.c_oAscNumberingFormat.Bullet) { if (!this.cmbFormat.store.findWhere({value: Asc.c_oAscNumberingFormat.Bullet, symbol: this.bulletProps.symbol, font: this.bulletProps.font})) @@ -714,6 +820,7 @@ define([ this.cmbFonts.setDisabled(format == Asc.c_oAscNumberingFormat.Bullet); this.btnBold.setDisabled(format == Asc.c_oAscNumberingFormat.Bullet); this.btnItalic.setDisabled(format == Asc.c_oAscNumberingFormat.Bullet); + this.chRestart.setDisabled(this.level===0); var arr = []; var me = this; @@ -950,7 +1057,13 @@ define([ txtStart: 'Start at', txtFontName: 'Font', textBold: 'Bold', - textItalic: 'Italic' + textItalic: 'Italic', + textTab: 'Tab character', + textSpace: 'Space', + txtAlignAt: 'Align at', + txtIndent: 'Text Indent', + txtFollow: 'Follow number with', + txtRestart: 'Restart list' }, DE.Views.ListSettingsDialog || {})) }); \ No newline at end of file