notificator.js
1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
arcs_module(
function(ARCS) {
var Notificator;
Notificator = ARCS.Component.create(
function () {
var notificationZone;
var self=this;
this.setNotificationZone = function( id ) {
notificationZone = document.getElementById(id);
};
this.display = function (message, timeout) {
if (notificationZone === undefined) {
return;
}
notificationZone.innerHTML = message;
notificationZone.style.display = "block";
if (timeout !== undefined) {
setTimeout(function () { self.hide();}, timeout);
}
};
this.hide = function () {
if (notificationZone === undefined) {
return;
}
notificationZone.style.display = "none";
};
},
["setNotificationZone", "display", "hide"],
[]
);
return { Notificator: Notificator};
}
);