mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-29 22:45:14 -04:00
Refactor notifications.
This commit is contained in:
parent
6500b624f5
commit
73496c6b7c
6 changed files with 40 additions and 39 deletions
19
src/_h5ai/client/js/inc/view/notification.js
Normal file
19
src/_h5ai/client/js/inc/view/notification.js
Normal 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
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue