Merge pull request #2548 from brkcvn/master

Send To Button Controlling
This commit is contained in:
Burak Civan
2022-07-27 11:31:58 +03:00
committed by GitHub
5 changed files with 12139 additions and 723 deletions

View File

@ -76,6 +76,7 @@ const app = new Vue({
',,'
],
email_template: false,
minor_form_loading: false
}
},
@ -661,13 +662,11 @@ const app = new Vue({
if (response.data.error) {
this.form.loading = false;
this.form.response = response.data;
}
})
.catch(error => {
this.form.loading = false;
this.form.onFail(error);
this.method_show_html = error.message;
@ -946,7 +945,7 @@ const app = new Vue({
let form_html = document.querySelector('form');
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', () => {
this.onBeforeUnload();
});
@ -954,6 +953,7 @@ const app = new Vue({
form_html.querySelectorAll('[type="submit"]').forEach((submit) => {
submit.addEventListener('click', () => {
this.minor_form_loading = false;
window.onbeforeunload = null;
});
});
@ -968,9 +968,33 @@ const app = new Vue({
},
onSubmitViaSendEmail() {
let type_submit_icon = document.querySelector('[type="submit"]').querySelector('i');
let type_submit_span = document.querySelector('[type="submit"]').querySelector('span');
this.form['senddocument'] = true;
this.minor_form_loading = true;
if (this.form.loading) {
type_submit_icon.classList.add('hidden');
type_submit_span.classList.add('opacity-100');
}
setTimeout(() => {
if (type_submit_icon && type_submit_span) {
type_submit_icon.classList.remove('hidden');
type_submit_span.classList.remove('opacity-100');
}
}, 5000);
this.onSubmit();
setTimeout(() => {
if (Object.keys(this.form.errors.errors.length > 0)) {
this.minor_form_loading = false;
return;
}
}, 200);
},
},
@ -1110,6 +1134,6 @@ const app = new Vue({
}
this.form.discount = this.form.discount.replace(',', '.');
},
}
},
});