diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 5f6bf40f5..5b2a20195 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -301,9 +301,14 @@ define([ options.primary = 'ok'; var newBtns = {}; _.each(options.buttons, function(b){ - newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b) ? 'primary' : ''}; - if (b=='custom') - newBtns[b].cls += ' custom'; + if (typeof(b) == 'object') { + if (b.value !== undefined) + newBtns[b.value] = {text: b.caption, cls: 'custom' + ((b.primary || options.primary==b.value) ? ' primary' : '')}; + } else { + newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b) ? 'primary' : ''}; + if (b=='custom') + newBtns[b].cls += ' custom'; + } }); options.buttons = newBtns;