From: Loic Baron Date: Thu, 15 Jan 2015 15:12:15 +0000 (+0100) Subject: Tools tab: Messages can be triggered several times after loading of the page X-Git-Tag: myslice-1.3~119^2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ed4060ed0f98d0fa514fa224e463700503ed989b;p=myslice.git Tools tab: Messages can be triggered several times after loading of the page --- diff --git a/portal/static/js/myslice-ui.js b/portal/static/js/myslice-ui.js index b8b331a7..bd31f5be 100644 --- a/portal/static/js/myslice-ui.js +++ b/portal/static/js/myslice-ui.js @@ -8,9 +8,10 @@ function mysliceAlert(msg, level, timeout) { var el = $('#myslice-message'); el.find('.message').text(msg); el.addClass('alert-' + level); + el.fadeIn('fast'); el.parent().fadeIn('fast'); if (timeout) { - setTimeout(function(){el.alert('close');},5000); + setTimeout(function(){el.hide();},5000); } }; /* Table initialisation */ @@ -20,14 +21,9 @@ $(document).ready(function() { }); var platformParameters = {}; - - $('#myslice-message').bind('closed.bs.alert', function () { - $(this).parent().hide(); - }); //mysliceAlert('hello','danger'); - $("#objectList").load("/table/resource/", {"fields" : ["hostname","hrn","country","type"], "options": ["checkbox"] }, function(data) { $(this).dataTable( { "sScrollY": window.innerHeight - 275,