Commit 00634b17 authored by System Administrator's avatar System Administrator

[etersoft] Cherry-pick 272fa8ca

parent 8a0d086c
......@@ -227,6 +227,17 @@ function validateComment(comment, workTimeValue, productiveTimeValue, validation
return errorObj;
}
//вывод окна с подтверждением при перезагрузке или закрытии страницы в случае, если поле комментария не пусто
window.addEventListener('beforeunload', function (event) {
// Cancel the event
if (document.getElementById("comment").value.length != 0){
// If you prevent default behavior in Mozilla Firefox prompt will always be shown
event.preventDefault();
// Chrome requires returnValue to be set
event.returnValue = '';
}
});
window.addEventListener("load", function() {
// работа с модальным окном
const openButton = document.querySelector("#commit");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment