From b7681efa4f6a31fb872aee29a958e073bceba5ab Mon Sep 17 00:00:00 2001 From: Ciro Scognamiglio Date: Tue, 6 May 2014 17:53:56 +0200 Subject: [PATCH] mysliceMessage() js function can be used to display a message --- portal/static/js/myslice-ui.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/portal/static/js/myslice-ui.js b/portal/static/js/myslice-ui.js index e2e8ad94..060269a8 100644 --- a/portal/static/js/myslice-ui.js +++ b/portal/static/js/myslice-ui.js @@ -2,12 +2,13 @@ /* * Call it with level: success, info, warning, danger */ -function mysliceAlert(msg, level = 'warning') { - var el = $('#myslice-message') +function mysliceAlert(msg, level) { + level = typeof level !== 'undefined' ? level : 'success'; + var el = $('#myslice-message'); el.find('.message').text(msg); el.addClass('alert-' + level); el.fadeIn('fast'); -} +}; /* Table initialisation */ $(document).ready(function() { -- 2.43.0