mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-31 23:38:20 -04:00
21 lines
442 B
JavaScript
21 lines
442 B
JavaScript
modulejs.define('view/notification', ['$', 'view/root'], function ($, root) {
|
|
|
|
var template = '<div id="notification"/>';
|
|
var $el = $(template);
|
|
|
|
function set(content) {
|
|
|
|
if (content) {
|
|
$el.stop(true, true).html(content).fadeIn(400);
|
|
} else {
|
|
$el.stop(true, true).fadeOut(400);
|
|
}
|
|
}
|
|
|
|
$el.hide().appendTo(root.$el);
|
|
|
|
return {
|
|
$el: $el,
|
|
set: set
|
|
};
|
|
});
|