type button onbeforeunload controlled

This commit is contained in:
Burak Civan 2022-07-28 16:50:35 +03:00
parent f7adcd3252
commit b8de8ec998

View File

@ -960,7 +960,7 @@ const app = new Vue({
let form_html = document.querySelector('form'); let form_html = document.querySelector('form');
if (form_html && form_html.getAttribute('id') == 'document') { if (form_html && form_html.getAttribute('id') == 'document') {
form_html.querySelectorAll('input, textarea, select, ul, li, a, [type="button"]').forEach((element) => { form_html.querySelectorAll('input, textarea, select, ul, li, a').forEach((element) => {
element.addEventListener('click', () => { element.addEventListener('click', () => {
this.onBeforeUnload(); this.onBeforeUnload();
}); });
@ -971,6 +971,12 @@ const app = new Vue({
window.onbeforeunload = null; window.onbeforeunload = null;
}); });
}); });
form_html.querySelectorAll('[type="button"]').forEach((button) => {
button.addEventListener('click', () => {
window.onbeforeunload = null;
});
});
} }
}, },