diff --git a/apps/documenteditor/main/app/view/ListSettingsDialog.js b/apps/documenteditor/main/app/view/ListSettingsDialog.js index f3ade193a..68f65945a 100644 --- a/apps/documenteditor/main/app/view/ListSettingsDialog.js +++ b/apps/documenteditor/main/app/view/ListSettingsDialog.js @@ -157,7 +157,12 @@ define([ this.api = options.api; this.options.tpl = _.template(this.template)(this.options); this.levels = []; - this.formatStrings = []; + this.formatString = { + selectionStart: 0, + selectionEnd: 0, + text: '', + lvlIndexes: [] + }; Common.UI.Window.prototype.initialize.call(this, this.options); }, @@ -368,8 +373,9 @@ define([ value : '' }); var $formatInput = this.txtNumFormat.$el.find('input'); - // $captionInput.on('mouseup', _.bind(this.checkStartPosition, this, 'mouse')); - // $captionInput.on('keydown', _.bind(this.checkStartPosition, this, 'key')); + $formatInput.on('mouseup', _.bind(this.checkMousePosition, this)); + // $formatInput.on('keydown', _.bind(this.checkStartPosition, this)); + $formatInput.on('input', _.bind(this.onFormatInput, this)); this.cmbLevel = new Common.UI.ComboBox({ el : $window.find('#id-dlg-numbering-format-lvl'), @@ -648,12 +654,12 @@ define([ makeFormatStr: function(props) { var formatStr = ''; - this.formatStrings[this.level] = []; + this.formatString.lvlIndexes[this.level] = []; if (props) { if (props.get_Format() !== Asc.c_oAscNumberingFormat.Bullet) { var text = props.get_Text(); var me = this; - var arr = this.formatStrings[this.level]; + var arr = this.formatString.lvlIndexes[this.level]; text.forEach(function (item, index) { if (item.get_Type() === Asc.c_oAscNumberingLvlTextType.Text) { formatStr += item.get_Value().toString(); @@ -669,6 +675,7 @@ define([ }); } } + this.formatString.text = formatStr; this.txtNumFormat.setValue(formatStr); }, @@ -678,7 +685,7 @@ define([ if (this._changedProps) { var text = this._changedProps.get_Text(), - arr = this.formatStrings[this.level]; + arr = this.formatString.lvlIndexes[this.level]; for (var i=0; i