Adds notifications.

This commit is contained in:
Lars Jung 2012-10-18 20:52:47 +02:00
parent 910312f7ce
commit c7a9d444af
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,17 @@
#notify {
position: fixed;
left: 50%;
top: 3px;
width: 200px;
margin-left: -100px;
z-index: 100;
padding: 2px 6px 2px 6px;
color: #fff;
// background-color: rgba(240, 100, 0, 0.5);
// border: 2px solid rgba(255, 255, 255, 0.5);
// border: 2px solid rgba(240, 100, 0, 0.9);
background-color: rgba(0, 0, 0, 0.2);
.border-radius(4px);
text-align: center;
}

View File

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