From 434ef607ea7e9c12230dded693c4edc33f49bd96 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 13 Apr 2016 15:38:25 +0300 Subject: [PATCH] =?UTF-8?q?[Common]=20Window:=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE?= =?UTF-8?q?=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=B7=D0=B0=D0=B4=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=BD=D0=B5=D1=81=D0=BA=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=BA=D0=B8=D1=85=20=D0=BA=D0=B0=D1=81=D1=82=D0=BE=D0=BC=D0=BD?= =?UTF-8?q?=D1=8B=D1=85=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BE=D0=BA=20=D0=B2=20?= =?UTF-8?q?=D0=B0=D0=BB=D0=B5=D1=80=D1=82=D1=8B.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/main/lib/component/Window.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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;