From: Loic Baron Date: Tue, 6 May 2014 16:19:55 +0000 (+0200) Subject: Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab X-Git-Tag: myslice-1.1~112 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=47e44bc61b088033691c43be4609e8c4248b2cb8;hp=06e175034e7784ab0de43331d16aef51f8eabd24;p=myslice.git Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab --- diff --git a/portal/static/js/myslice-ui.js b/portal/static/js/myslice-ui.js index 4d06895e..1c91ccd2 100644 --- a/portal/static/js/myslice-ui.js +++ b/portal/static/js/myslice-ui.js @@ -2,19 +2,27 @@ /* * Call it with level: success, info, warning, danger */ -function mysliceAlert(msg, level) { +function mysliceAlert(msg, level, timeout) { level = typeof level !== 'undefined' ? level : 'success'; + timeout = typeof timeout !== 'undefined' ? timeout : false; var el = $('#myslice-message'); el.find('.message').text(msg); el.addClass('alert-' + level); el.parent().fadeIn('fast'); + if (timeout) { + setTimeout(function(){el.alert('close');},5000); + } }; /* Table initialisation */ $(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) { diff --git a/portal/templates/_widget-message.html b/portal/templates/_widget-message.html index 8ffad257..2fe3d0c7 100644 --- a/portal/templates/_widget-message.html +++ b/portal/templates/_widget-message.html @@ -1,4 +1,4 @@ -
+