diff --git a/assets/js/backend.js b/assets/js/backend.js index 8445c1fb..cc488424 100644 --- a/assets/js/backend.js +++ b/assets/js/backend.js @@ -120,7 +120,7 @@ window.Backend = window.Backend || {}; $notification.empty(); - $('
', { + var $instance = $('', { 'class': 'notification alert', 'html': [ $('', { @@ -135,25 +135,20 @@ window.Backend = window.Backend || {}; }), $('', { 'html': message - }), - + }) ] }) .appendTo($notification); - $.each(actions, function (index, action) { - var actionId = action.label.toLowerCase().replace(' ', '-'); - + actions.forEach(function(action) { $('', { - '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');