updated by GasGit automation
This commit is contained in:
parent
d1ca25f508
commit
44efd169f1
1 changed files with 32 additions and 28 deletions
|
@ -1,34 +1,38 @@
|
|||
/* Common app functionality */
|
||||
|
||||
var App = (function startApp (app) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
|
||||
// sets up all the app management divs.
|
||||
app.initialize = function () {
|
||||
var container = Utils.el("container");
|
||||
var notification = Utils.elAdd(container,"div","notification");
|
||||
notification.id = "notification";
|
||||
Utils.elAdd(notification,"div","notification-close").id = "notification-close";
|
||||
Utils.elAdd(notification,"div","notification-header").id = "notification-header";
|
||||
Utils.elAdd(notification,"div","notification-message").id = "notification-message";
|
||||
// sets up all the app management divs.
|
||||
app.initialize = function () {
|
||||
|
||||
app.showNotification = function (header, text) {
|
||||
Utils.el('notification-header').innerHTML=header;
|
||||
Utils.el('notification-message').innerHTML =text;
|
||||
Utils.show(notification);
|
||||
};
|
||||
app.showNotification = function (header, text, toast) {
|
||||
DomUtils.elem('notification-header').innerHTML=header;
|
||||
DomUtils.elem('notification-message').innerHTML =text;
|
||||
DomUtils.hide('notification-area',true, toast ? "notification-toast-header" : "notification-error-header");
|
||||
DomUtils.hide('notification-header',true, toast ? "notification-toast-header" : "notification-error-header");
|
||||
DomUtils.hide('notification-message',true, toast ? "notification-toast-message" : "notification-error-message");
|
||||
DomUtils.hide('notification-area',false);
|
||||
};
|
||||
|
||||
app.hideNotification = function () {
|
||||
Utils.hide(notification);
|
||||
};
|
||||
app.hideNotification = function () {
|
||||
DomUtils.hide('notification-area',true);
|
||||
};
|
||||
|
||||
Utils.el('notification-close').addEventListener("click", function () {
|
||||
Utils.hide(notification);
|
||||
},false);
|
||||
app.toast = function (header,text) {
|
||||
app.showNotification (header,text,true);
|
||||
setTimeout (function () {
|
||||
app.hideNotification();
|
||||
},Process.control.toast.interval);
|
||||
}
|
||||
|
||||
};
|
||||
DomUtils.elem('notification-close').addEventListener("click", function () {
|
||||
DomUtils.hide('notification-area',true);
|
||||
},false);
|
||||
|
||||
return app;
|
||||
};
|
||||
|
||||
return app;
|
||||
})(App || {});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue