[Common] Window: добавлена возможность задания нескольких кастомных кнопок в алерты.
This commit is contained in:
parent
091c0c7a50
commit
434ef607ea
|
@ -301,9 +301,14 @@ define([
|
||||||
options.primary = 'ok';
|
options.primary = 'ok';
|
||||||
var newBtns = {};
|
var newBtns = {};
|
||||||
_.each(options.buttons, function(b){
|
_.each(options.buttons, function(b){
|
||||||
newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b) ? 'primary' : ''};
|
if (typeof(b) == 'object') {
|
||||||
if (b=='custom')
|
if (b.value !== undefined)
|
||||||
newBtns[b].cls += ' custom';
|
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;
|
options.buttons = newBtns;
|
||||||
|
|
Loading…
Reference in a new issue