Corrected the selector for notification actions (#753).
This commit is contained in:
parent
08144ceae8
commit
9b924cd3c1
1 changed files with 8 additions and 13 deletions
|
@ -120,7 +120,7 @@ window.Backend = window.Backend || {};
|
||||||
|
|
||||||
$notification.empty();
|
$notification.empty();
|
||||||
|
|
||||||
$('<div/>', {
|
var $instance = $('<div/>', {
|
||||||
'class': 'notification alert',
|
'class': 'notification alert',
|
||||||
'html': [
|
'html': [
|
||||||
$('<button/>', {
|
$('<button/>', {
|
||||||
|
@ -135,25 +135,20 @@ window.Backend = window.Backend || {};
|
||||||
}),
|
}),
|
||||||
$('<strong/>', {
|
$('<strong/>', {
|
||||||
'html': message
|
'html': message
|
||||||
}),
|
})
|
||||||
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
.appendTo($notification);
|
.appendTo($notification);
|
||||||
|
|
||||||
$.each(actions, function (index, action) {
|
actions.forEach(function(action) {
|
||||||
var actionId = action.label.toLowerCase().replace(' ', '-');
|
|
||||||
|
|
||||||
$('<button/>', {
|
$('<button/>', {
|
||||||
'id': actionId,
|
|
||||||
'class': 'btn btn-default btn-xs',
|
'class': 'btn btn-default btn-xs',
|
||||||
'text': action.label
|
'text': action.label,
|
||||||
|
'on': {
|
||||||
|
'click': action.function
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.appendTo($notification);
|
.appendTo($instance);
|
||||||
|
|
||||||
$(document)
|
|
||||||
.off('click', '#' + actionId)
|
|
||||||
.on('click', '#' + actionId, action.function);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$notification.show('fade');
|
$notification.show('fade');
|
||||||
|
|
Loading…
Reference in a new issue