Refactor notifications.

This commit is contained in:
Lars Jung 2015-04-29 00:57:58 +02:00
parent 6500b624f5
commit 73496c6b7c
6 changed files with 40 additions and 39 deletions

View file

@ -0,0 +1,19 @@
modulejs.define('view/notification', ['$'], function ($) {
var template = '<div id="notification"/>';
function set(content) {
if (content) {
$('#notification').stop(true, true).html(content).fadeIn(400);
} else {
$('#notification').stop(true, true).fadeOut(400);
}
}
$(template).hide().appendTo('body');
return {
set: set
};
});