13 lines
303 B
JavaScript
13 lines
303 B
JavaScript
|
var notification = function(msg, err) {
|
||
|
var el = document.getElementById('js-notification')
|
||
|
if(err) {el.className = 'show error'}
|
||
|
else {el.className = 'show'}
|
||
|
el.innerText = msg
|
||
|
window.setTimeout(function() {
|
||
|
el.className = ''
|
||
|
el.innerText = ''
|
||
|
}, 7000)
|
||
|
}
|
||
|
module.exports = notification
|
||
|
|