Просмотр исходного кода

fix popup uscita pagina su salva e chiudi

ferrari 4 месяцев назад
Родитель
Сommit
c98c881df4
1 измененных файлов с 12 добавлено и 2 удалено
  1. 12 2
      resources/views/livewire/member.blade.php

+ 12 - 2
resources/views/livewire/member.blade.php

@@ -1723,11 +1723,11 @@
                             <div class="col-md-7 col-xl-8 d-flex gx-0">
                             <div class="col-md-7 col-xl-8 d-flex gx-0">
                                 @if($add)
                                 @if($add)
                                     <button class="btn--ui primary d-flex order-1 me-2" wire:click="store(false)">salva e continua</button>
                                     <button class="btn--ui primary d-flex order-1 me-2" wire:click="store(false)">salva e continua</button>
-                                    <button class="btn--ui primary d-flex order-3 ms-auto" wire:click="store(true)">salva e chiudi</button>
+                                    <button class="btn--ui primary d-flex order-3 ms-auto" onclick="store(true)">salva e chiudi</button>
                                 @endif
                                 @endif
                                 @if($update)
                                 @if($update)
                                     <button class="btn--ui primary d-flex order-1 me-2" wire:click="updateAAA(false)">salva e continua</button>
                                     <button class="btn--ui primary d-flex order-1 me-2" wire:click="updateAAA(false)">salva e continua</button>
-                                    <button class="btn--ui primary d-flex order-3 ms-auto" wire:click="updateAAA(true)">salva e chiudi</button>
+                                    <button class="btn--ui primary d-flex order-3 ms-auto" onclick="updateAAA(true)">salva e chiudi</button>
                                 @endif
                                 @endif
                                 <button class="btn--ui lightGrey" onclick="annulla()" style="margin-right:10px">annulla</button><br><br>
                                 <button class="btn--ui lightGrey" onclick="annulla()" style="margin-right:10px">annulla</button><br><br>
                             </div>
                             </div>
@@ -2693,6 +2693,16 @@
             document.location.href = '/members';
             document.location.href = '/members';
         }
         }
 
 
+        function store(reload) {
+            window.onbeforeunload = null;
+            @this.store(reload)
+        }
+
+        function updateAAA(reload) {
+            window.onbeforeunload = null;
+            @this.updateAAA(reload)
+        }
+
         window.onbeforeunload = function(){
         window.onbeforeunload = function(){
             if (isEdit)
             if (isEdit)
                 return 'Cambiando pagina le eventuali modifiche andranno perse';
                 return 'Cambiando pagina le eventuali modifiche andranno perse';