mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 12:34:47 -04:00
Adds notifications.
This commit is contained in:
parent
910312f7ce
commit
c7a9d444af
2 changed files with 46 additions and 0 deletions
17
src/_h5ai/client/css/inc/notify.less
Normal file
17
src/_h5ai/client/css/inc/notify.less
Normal 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;
|
||||||
|
}
|
29
src/_h5ai/client/js/inc/core/notify.js
Normal file
29
src/_h5ai/client/js/inc/core/notify.js
Normal 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
|
||||||
|
};
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue