diff --git a/apps/documenteditor/main/app/controller/Links.js b/apps/documenteditor/main/app/controller/Links.js index 036e4843d..fc983122c 100644 --- a/apps/documenteditor/main/app/controller/Links.js +++ b/apps/documenteditor/main/app/controller/Links.js @@ -337,6 +337,7 @@ define([ Common.NotificationCenter.trigger('edit:complete', me.toolbar); }, isEndNote: isEndNote, + hasSections: me.api.asc_GetSectionsCount()>1, props: isEndNote ? me.api.asc_GetEndnoteProps() : me.api.asc_GetFootnoteProps() })).show(); break; diff --git a/apps/documenteditor/main/app/view/NoteSettingsDialog.js b/apps/documenteditor/main/app/view/NoteSettingsDialog.js index adb5f8452..297e73ed0 100644 --- a/apps/documenteditor/main/app/view/NoteSettingsDialog.js +++ b/apps/documenteditor/main/app/view/NoteSettingsDialog.js @@ -130,6 +130,7 @@ define([ this.handler = options.handler; this.props = options.props; this.isEndNote = options.isEndNote || false; + this.hasSections = options.hasSections || false; Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options); @@ -260,17 +261,16 @@ define([ me.btnApply.setDisabled(value.length>0); }); + var arr = this.hasSections ? [{ displayValue: this.textSection, value: 0 }] : []; + arr.push({ displayValue: this.textDocument, value: 1 }); this.cmbApply = new Common.UI.ComboBox({ el: $('#note-settings-combo-apply'), cls: 'input-group-nr', menuStyle: 'min-width: 150px;', editable: false, - data: [ - { displayValue: this.textDocument, value: 1 }, - { displayValue: this.textSection, value: 0 } - ] + data: arr }); - this.cmbApply.setValue(1); + this.cmbApply.setValue(arr[0].value); this.btnApply = new Common.UI.Button({ el: $('#note-settings-btn-apply')