Skip to content

Instantly share code, notes, and snippets.

@Liongold
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Liongold/3158060510cc94ad8e6d to your computer and use it in GitHub Desktop.
Save Liongold/3158060510cc94ad8e6d to your computer and use it in GitHub Desktop.
A snippet showing a possible implementation of Status Notifications in Paperwork UI
angular.module('applicationX').factory('notification', function() {
var notificationservice = {};
notificationservice.notify = function(type, message) {
console.log("test");
console.log(type);
var div = document.getElementById("notification");
div.children[0].innerHTML = message;
div.classList.add(type);
div.classList.remove("hidden");
var divheight = div.offsetHeight;
// Hide after 5 seconds
window.onload = function() {
setTimeout(function() {
div.classList.add("hidden");
}, 5000);
};
};
return notificationservice;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment