updated by GasGit automation

This commit is contained in:
Bruce McPherson 2016-05-24 15:08:10 +01:00
parent d1ca25f508
commit 44efd169f1

View file

@ -1,34 +1,38 @@
/* Common app functionality */ /* Common app functionality */
var App = (function startApp (app) { var App = (function startApp (app) {
'use strict'; 'use strict';
// sets up all the app management divs. // sets up all the app management divs.
app.initialize = function () { 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";
app.showNotification = function (header, text) { app.showNotification = function (header, text, toast) {
Utils.el('notification-header').innerHTML=header; DomUtils.elem('notification-header').innerHTML=header;
Utils.el('notification-message').innerHTML =text; DomUtils.elem('notification-message').innerHTML =text;
Utils.show(notification); 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");
app.hideNotification = function () { DomUtils.hide('notification-area',false);
Utils.hide(notification); };
};
app.hideNotification = function () {
Utils.el('notification-close').addEventListener("click", function () { DomUtils.hide('notification-area',true);
Utils.hide(notification); };
},false);
app.toast = function (header,text) {
}; app.showNotification (header,text,true);
setTimeout (function () {
return app; app.hideNotification();
},Process.control.toast.interval);
}
DomUtils.elem('notification-close').addEventListener("click", function () {
DomUtils.hide('notification-area',true);
},false);
};
return app;
})(App || {}); })(App || {});