-
-
Save Liongold/3158060510cc94ad8e6d to your computer and use it in GitHub Desktop.
A snippet showing a possible implementation of Status Notifications in Paperwork UI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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