Set one primary button in dialog

This commit is contained in:
Julia Radzhabova 2019-07-31 17:26:28 +03:00
parent 4f4be61a39
commit 9ee50c2847
2 changed files with 10 additions and 10 deletions

View file

@ -123,7 +123,7 @@ define([
'</div>', '</div>',
'<div class="footer center">', '<div class="footer center">',
'<button class="btn normal dlg-btn primary" result="insert" style="margin-right: 10px; width: 86px;">' + me.textInsert + '</button>', '<button class="btn normal dlg-btn primary" result="insert" style="margin-right: 10px; width: 86px;">' + me.textInsert + '</button>',
'<button id="note-settings-btn-apply" class="btn normal dlg-btn primary" result="apply" style="margin-right: 10px; width: 86px;">' + me.textApply + '</button>', '<button id="note-settings-btn-apply" class="btn normal dlg-btn" result="apply" style="margin-right: 10px; width: 86px;">' + me.textApply + '</button>',
'<button class="btn normal dlg-btn" result="cancel" style="width: 86px;">' + me.textCancel + '</button>', '<button class="btn normal dlg-btn" result="cancel" style="width: 86px;">' + me.textCancel + '</button>',
'</div>' '</div>'
].join('') ].join('')
@ -271,17 +271,17 @@ define([
}, },
onDlgBtnClick: function(event) { onDlgBtnClick: function(event) {
var me = this; this._handleInput((typeof(event) == 'object') ? event.currentTarget.attributes['result'].value : event);
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();
}, },
onPrimary: function() { 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) { onFormatSelect: function(combo, record) {

View file

@ -74,8 +74,8 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template',
'</div>', '</div>',
'<div class="separator horizontal"/>', '<div class="separator horizontal"/>',
'<div class="footer center">', '<div class="footer center">',
'<button class="btn normal dlg-btn primary" result="all" style="margin-right: 10px;width: auto; min-width: 86px;">' + me.applyAllText + '</button>',
'<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;width: auto; min-width: 86px;">' + me.applyText + '</button>', '<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;width: auto; min-width: 86px;">' + me.applyText + '</button>',
'<button class="btn normal dlg-btn" result="all" style="margin-right: 10px;width: auto; min-width: 86px;">' + me.applyAllText + '</button>',
'<button class="btn normal dlg-btn" result="cancel">' + me.cancelButtonText + '</button>', '<button class="btn normal dlg-btn" result="cancel">' + me.cancelButtonText + '</button>',
'</div>' '</div>'
].join('') ].join('')