Commit b2243695 authored by Marc Duez's avatar Marc Duez

database.js : flash message

parent ebcaad26
......@@ -1080,4 +1080,24 @@ span.logo
@-webkit-keyframes move {
to { background-position: 50px 50px; }
}
#flash_mes {
position : absolute;
display : block;
bottom : 0px;
right : 0px;
}
.flash {
width: 350px;
min-height: 20px;
border: solid;
border-width: 1px;
display: block;
border-radius: 5px;
padding: 5px;
margin: 5px;
background: @background;
border-color: @border;
}
\ No newline at end of file
......@@ -273,6 +273,9 @@
</div>
</div>
<div id="flash_mes">
</div>
<form id="form"></form>
</body>
......
......@@ -68,9 +68,8 @@ Database.prototype = {
var res = jQuery.parseJSON(result);
if (res.redirect) this.call(res.redirect, res.args)
//TODO : implémenter un flash message
if (res.message) console.log("database log : "+res.message)
if (res.message) this.flash("database : "+res.message)
return res
}
......@@ -404,6 +403,22 @@ Database.prototype = {
fixedHeader.css("top", offset)
});
},
flash: function (str){
var div = jQuery('<div/>', {
text: str,
style: 'display : none',
class: 'flash'
}).appendTo('#flash_mes')
.slideDown(200);
setTimeout(function(){
div.fadeOut('slow', function() { div.remove();});
}, 5000);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment