Repository navigation
Expand file tree
/
Copy pathtypes.js
More file actions
57 lines (54 loc) · 2.08 KB
/
Copy pathtypes.js
File metadata and controls
57 lines (54 loc) · 2.08 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* Sample for types of toast
*/
this.default = function () {
var toastObj = new ej.notifications.Toast({
position: {
X: 'Right'
}, target: document.body,
close: onclose,
beforeOpen: onBeforeOpen
});
toastObj.appendTo('#toast_type');
var toasts = [
{ title: 'Warning!', content: 'There was a problem with your network connection.', cssClass: 'e-toast-warning', icon: 'e-warning toast-icons' },
{ title: 'Success!', content: 'Your message has been sent successfully.', cssClass: 'e-toast-success', icon: 'e-success toast-icons' },
{ title: 'Error!', content: 'A problem has been occurred while submitting your data.', cssClass: 'e-toast-danger', icon: 'e-error toast-icons' },
{ title: 'Information!', content: 'Please read the comments carefully.', cssClass: 'e-toast-info', icon: 'e-info toast-icons' }
];
setTimeout(function () {
toastObj.show(toasts[3]);
}, 200);
var infoBtn = document.getElementById('info_Toast');
var warnBtn = document.getElementById('warning_Toast');
var successBtn = document.getElementById('success_Toast');
var errorBtn = document.getElementById('error_Toast');
document.onclick = function (e) {
if (e.target !== infoBtn && e.target !== warnBtn && e.target !== successBtn && e.target !== errorBtn) {
toastObj.hide('All');
}
};
function onclose (e){
if (e.toastContainer.childElementCount === 0 ) {
document.getElementById('hideTosat').style.display = 'none';
}
}
function onBeforeOpen (){
document.getElementById('hideTosat').style.display = 'inline-block';
}
document.getElementById('hideTosat').onclick = function () {
toastObj.hide('All');
};
infoBtn.onclick = function () {
toastObj.show(toasts[3]);
};
warnBtn.onclick = function () {
toastObj.show(toasts[0]);
};
successBtn.onclick = function () {
toastObj.show(toasts[1]);
};
errorBtn.onclick = function () {
toastObj.show(toasts[2]);
};
};