mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-09 17:42:21 +03:00
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();
|
||||
|
||||
$('<div/>', {
|
||||
var $instance = $('<div/>', {
|
||||
'class': 'notification alert',
|
||||
'html': [
|
||||
$('<button/>', {
|
||||
|
@ -135,25 +135,20 @@ window.Backend = window.Backend || {};
|
|||
}),
|
||||
$('<strong/>', {
|
||||
'html': message
|
||||
}),
|
||||
|
||||
})
|
||||
]
|
||||
})
|
||||
.appendTo($notification);
|
||||
|
||||
$.each(actions, function (index, action) {
|
||||
var actionId = action.label.toLowerCase().replace(' ', '-');
|
||||
|
||||
actions.forEach(function(action) {
|
||||
$('<button/>', {
|
||||
'id': actionId,
|
||||
'class': 'btn btn-default btn-xs',
|
||||
'text': action.label
|
||||
'text': action.label,
|
||||
'on': {
|
||||
'click': action.function
|
||||
}
|
||||
})
|
||||
.appendTo($notification);
|
||||
|
||||
$(document)
|
||||
.off('click', '#' + actionId)
|
||||
.on('click', '#' + actionId, action.function);
|
||||
.appendTo($instance);
|
||||
});
|
||||
|
||||
$notification.show('fade');
|
||||
|
|
Loading…
Reference in a new issue