diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index b1fb40d255..f7a869d054 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -178,9 +178,9 @@ define([ '
<%= tpl %>' + '<% if (typeof (buttons) !== "undefined" && _.size(buttons) > 0) { %>' + '' + '<% } %>' + '
' + @@ -626,15 +626,16 @@ define([ if (options.buttons && _.isArray(options.buttons)) { if (options.primary==undefined) options.primary = 'ok'; - var newBtns = {}; + var newBtns = []; _.each(options.buttons, function(b){ if (typeof(b) == 'object') { if (b.value !== undefined) { - newBtns[b.value] = {text: b.caption, cls: 'auto' + ((b.primary || options.primary==b.value) ? ' primary' : '')}; - b.id && (newBtns[b.value].id = b.id); + var item = {value: b.value, text: b.caption, cls: 'auto' + ((b.primary || options.primary==b.value) ? ' primary' : '')}; + b.id && (item.id = b.id); + newBtns.push(item); } } else if (b!==undefined) { - newBtns[b] = {text: arrBtns[b], cls: (options.primary==b || _.indexOf(options.primary, b)>-1) ? 'primary' : ''}; + newBtns.push({value: b, text: arrBtns[b], cls: (options.primary==b || _.indexOf(options.primary, b)>-1) ? 'primary' : ''}); } }); diff --git a/apps/common/main/lib/template/ExtendedColorDialog.template b/apps/common/main/lib/template/ExtendedColorDialog.template index 29796da59e..d4a55b951b 100644 --- a/apps/common/main/lib/template/ExtendedColorDialog.template +++ b/apps/common/main/lib/template/ExtendedColorDialog.template @@ -26,7 +26,3 @@ - diff --git a/apps/common/main/lib/view/ExtendedColorDialog.js b/apps/common/main/lib/view/ExtendedColorDialog.js index c80c5cce19..12eb9a3430 100644 --- a/apps/common/main/lib/view/ExtendedColorDialog.js +++ b/apps/common/main/lib/view/ExtendedColorDialog.js @@ -51,11 +51,11 @@ define([ cls: 'extended-color-dlg modal-dlg', tpl: this.tpl({ txtNew: this.textNew, - txtCurrent: this.textCurrent, - txtAdd: this.addButtonText, - txtCancel: this.cancelButtonText + txtCurrent: this.textCurrent }), header: false, + buttons: [{value: '1', caption: this.addButtonText}, {value: '0', caption: this.cancelButtonText}], + primary: '1', width: 340 }); diff --git a/apps/common/main/lib/view/OpenDialog.js b/apps/common/main/lib/view/OpenDialog.js index fdca2c612b..5a0d8ef0a6 100644 --- a/apps/common/main/lib/view/OpenDialog.js +++ b/apps/common/main/lib/view/OpenDialog.js @@ -63,8 +63,8 @@ define([ cls : 'modal-dlg open-dlg', contentTemplate : '', toolcallback : _.bind(t.onToolClose, t), - closeFile : false - + closeFile : false, + buttons : ['ok'].concat(options.closeFile ? [{value: 'cancel', caption: this.closeButtonText}] : []).concat(options.closable ? ['cancel'] : []), }, options); this.txtOpenFile = options.txtOpenFile || this.txtOpenFile; @@ -134,15 +134,6 @@ define([ '<% } %>', '<% } %>', '', - '', - '' ].join(''); diff --git a/apps/common/main/lib/view/SignSettingsDialog.js b/apps/common/main/lib/view/SignSettingsDialog.js index e9656b2c89..5b7891c06e 100644 --- a/apps/common/main/lib/view/SignSettingsDialog.js +++ b/apps/common/main/lib/view/SignSettingsDialog.js @@ -58,7 +58,8 @@ define([ initialize : function(options) { _.extend(this.options, { - title: this.textTitle + title: this.textTitle, + buttons: ['ok'].concat((options.type || this.options.type) === 'edit' ? ['cancel'] : []), }, options || {}); this.template = [ @@ -80,12 +81,6 @@ define([ '', '
', '
', - '', - '' ].join('');