25 lines
627 B
Plaintext
25 lines
627 B
Plaintext
(function() {
|
|
'use strict';
|
|
|
|
window.utils = window.utils || {};
|
|
|
|
window.utils.alert = function(alertEl) {
|
|
var closeEl = document.createElement('DIV');
|
|
closeEl.classList.add('alert__close');
|
|
closeEl.innerText = #{String (messageRender MsgCloseAlert)};
|
|
closeEl.addEventListener('click', function(event) {
|
|
alertEl.classList.add('alert--invisible');
|
|
});
|
|
alertEl.appendChild(closeEl);
|
|
}
|
|
|
|
})();
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
// setup alerts
|
|
Array.from(document.querySelectorAll('.alert')).forEach(function(alertEl) {
|
|
window.utils.alert(alertEl);
|
|
});
|
|
});
|