From 9ee50c2847bab8557ad8cef94207a09c86eb47be Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 31 Jul 2019 17:26:28 +0300 Subject: [PATCH] Set one primary button in dialog --- .../main/app/view/NoteSettingsDialog.js | 18 +++++++++--------- .../main/app/view/HeaderFooterDialog.js | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/documenteditor/main/app/view/NoteSettingsDialog.js b/apps/documenteditor/main/app/view/NoteSettingsDialog.js index 9a3f841b4..e5571e63e 100644 --- a/apps/documenteditor/main/app/view/NoteSettingsDialog.js +++ b/apps/documenteditor/main/app/view/NoteSettingsDialog.js @@ -123,7 +123,7 @@ define([ '', '' ].join('') @@ -271,17 +271,17 @@ define([ }, onDlgBtnClick: function(event) { - var me = this; - var state = (typeof(event) == 'object') ? event.currentTarget.attributes['result'].value : event; - if (state == 'insert' || state == 'apply') { - this.handler && this.handler.call(this, state, (state == 'insert' || state == 'apply') ? this.getSettings() : undefined); - } - - this.close(); + this._handleInput((typeof(event) == 'object') ? event.currentTarget.attributes['result'].value : event); }, onPrimary: function() { - return true; + this._handleInput('insert'); + return false; + }, + + _handleInput: function(state) { + this.handler && this.handler.call(this, state, (state == 'insert' || state == 'apply') ? this.getSettings() : undefined); + this.close(); }, onFormatSelect: function(combo, record) { diff --git a/apps/presentationeditor/main/app/view/HeaderFooterDialog.js b/apps/presentationeditor/main/app/view/HeaderFooterDialog.js index 5995651dd..bb8575a7a 100644 --- a/apps/presentationeditor/main/app/view/HeaderFooterDialog.js +++ b/apps/presentationeditor/main/app/view/HeaderFooterDialog.js @@ -74,8 +74,8 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template', '', '
', '' ].join('')