From 280c9d0ebb1c828baf1cca3ae0a5ef5272ff2bd9 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Fri, 27 Jan 2023 15:54:59 +0100 Subject: [PATCH] Replace the toast function with a bootstrap equivalent --- assets/js/layouts/backend_layout.js | 56 ++++++++++++++--------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/assets/js/layouts/backend_layout.js b/assets/js/layouts/backend_layout.js index 92b0d416..3107acb3 100644 --- a/assets/js/layouts/backend_layout.js +++ b/assets/js/layouts/backend_layout.js @@ -47,42 +47,38 @@ window.App.Layouts.Backend = (function () { * @param {Array} [actions] An array with custom actions that will be available to the user. Every array item is an * object that contains the 'label' and 'function' key values. */ - function displayNotification(message = '- No message provided for this notification -', actions = null) { - if (!actions) { - actions = []; - - setTimeout(() => { - $notification.fadeOut(); - }, 5000); + function displayNotification(message, actions = []) { + if (!message) { + return; } - $notification.empty(); + const $toast = $(` + + `).appendTo('body'); - const $instance = $('
', { - 'class': 'notification alert alert-dismissible fade show', - 'html': [ - $('', { - 'html': message - }), - $('