32
									
								
								resources/assets/js/views/common/documents.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										32
									
								
								resources/assets/js/views/common/documents.js
									
									
									
									
										vendored
									
									
								
							| @@ -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(',', '.'); | ||||
|         }, | ||||
|         } | ||||
|     }, | ||||
| }); | ||||
|   | ||||
| @@ -11,8 +11,8 @@ | ||||
|                 ::disabled="form.loading" | ||||
|                 @click="onSubmitViaSendEmail" | ||||
|             > | ||||
|                 <i v-if="form.loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:-left-3.5 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:-right-3.5 after:rounded-full after:animate-submit after:delay-[0.42s]"></i> | ||||
|                 <span :class="[{'opacity-0': form.loading}]"> | ||||
|                 <i v-if="minor_form_loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:-left-3.5 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:-right-3.5 after:rounded-full after:animate-submit after:delay-[0.42s]"></i> | ||||
|                 <span :class="[{'opacity-0': minor_form_loading}]"> | ||||
|                     {{ trans('general.send_to') }} | ||||
|                 </span> | ||||
|             </x-button> | ||||
|   | ||||
| @@ -27,7 +27,7 @@ | ||||
|                         <div role="tablist" class="flex flex-wrap"> | ||||
|                             @php $is_active = true; @endphp | ||||
|  | ||||
|                             <div class="swiper swiper-links"> | ||||
|                             <div class="swiper swiper-links w-full"> | ||||
|                                 <div class="swiper-wrapper"> | ||||
|                                     @foreach ($payment_methods as $key => $name) | ||||
|                                         @stack('invoice_{{ $key }}_tab_start') | ||||
|   | ||||
| @@ -34,7 +34,7 @@ | ||||
|                             <div role="tablist" class="flex flex-wrap"> | ||||
|                                 @php $is_active = true; @endphp | ||||
|  | ||||
|                                 <div class="swiper swiper-links"> | ||||
|                                 <div class="swiper swiper-links w-full"> | ||||
|                                     <div class="swiper-wrapper"> | ||||
|                                         @foreach ($payment_methods as $key => $name) | ||||
|                                             @stack('invoice_{{ $key }}_tab_start') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user