diff --git a/public/css/e-ops-pf/starter-kit/app.css b/public/css/e-ops-pf/starter-kit/app.css index d161938..240774c 100644 --- a/public/css/e-ops-pf/starter-kit/app.css +++ b/public/css/e-ops-pf/starter-kit/app.css @@ -1 +1 @@ -@source inline("loading-bars loading-infinity loading-circle loading-spinner loading-ring loading-ball"); #loading-overlay{display: none; position: fixed; top:0; left:0; width: 100%; height: 100%; min-height: 100vh; background: rgba(45,45,65,.6); z-index: 100;}#loading-overlay div{margin:auto} +@source inline("loading-bars loading-infinity loading-circle loading-spinner loading-ring loading-ball");#loading-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;min-height:100vh;background:#2d2d4199;z-index:100}#loading-overlay div{margin:auto} diff --git a/public/js/e-ops-pf/starter-kit/app.js b/public/js/e-ops-pf/starter-kit/app.js index 553a672..a9c6032 100644 --- a/public/js/e-ops-pf/starter-kit/app.js +++ b/public/js/e-ops-pf/starter-kit/app.js @@ -1 +1 @@ -document.addEventListener("alpine:init",()=>{Alpine.directive("confirm-modal",(c,a,{evaluate:l})=>{c.addEventListener("click",m=>{m.preventDefault();const o=document.getElementById("global-confirm-modal"),e=c.dataset;console.log("Dataset:",e),document.getElementById("confirm-title").innerHTML=e.title||"Confirm Action",document.getElementById("confirm-message").innerHTML=e.message||"Are you sure you want to proceed?",document.getElementById("confirm-cancel").innerHTML=e.cancelLabel||"Cancel",document.getElementById("confirm-confirm").innerHTML=e.confirmLabel||"Confirm",document.getElementById("confirm-confirm").addEventListener("click",()=>{var d;if(e.url)window.location.href=e.url;else if(e.action){const t=document.createElement("form");t.method="POST",t.action=e.action;const i=(d=document.querySelector('meta[name="csrf-token"]'))==null?void 0:d.content;if(i){const n=document.createElement("input");n.type="hidden",n.name="_token",n.value=i,t.appendChild(n)}if(e.method&&e.method.toUpperCase()!=="POST"){const n=document.createElement("input");n.type="hidden",n.name="_method",n.value=e.method,t.appendChild(n)}document.body.appendChild(t),t.submit()}else console.error("No URL or action specified for confirmation."),o.close()}),document.getElementById("confirm-cancel").addEventListener("click",()=>{o.close()}),o.showModal()})})}); +document.addEventListener("alpine:init",()=>{Alpine.directive("confirm-modal",(t,c,{evaluate:a})=>{t.addEventListener("click",m=>{m.preventDefault();const d=document.getElementById("global-confirm-modal"),e=t.dataset;console.log("Dataset:",e),document.getElementById("confirm-title").innerHTML=e.title||"Confirm Action",document.getElementById("confirm-message").innerHTML=e.message||"Are you sure you want to proceed?",document.getElementById("confirm-cancel").innerHTML=e.cancelLabel||"Cancel",document.getElementById("confirm-confirm").innerHTML=e.confirmLabel||"Confirm",document.getElementById("confirm-confirm").addEventListener("click",()=>{var i;if(e.url)window.location.href=e.url;else if(e.action){const o=document.createElement("form");o.method="POST",o.action=e.action;const r=(i=document.querySelector('meta[name="csrf-token"]'))==null?void 0:i.content;if(r){const n=document.createElement("input");n.type="hidden",n.name="_token",n.value=r,o.appendChild(n)}if(e.method&&e.method.toUpperCase()!=="POST"){const n=document.createElement("input");n.type="hidden",n.name="_method",n.value=e.method,o.appendChild(n)}document.body.appendChild(o),o.submit()}else console.error("No URL or action specified for confirmation."),d.close()}),document.getElementById("confirm-cancel").addEventListener("click",()=>{d.close()}),d.showModal()})})});(function(){const t=()=>{document.querySelectorAll(".dropdown.dropdown-open").forEach(c=>c.classList.remove("dropdown-open")),document.querySelectorAll("details[open]").forEach(c=>c.removeAttribute("open")),document.activeElement&&document.activeElement.blur&&document.activeElement.blur()};window.addEventListener("livewire:navigated",t),window.addEventListener("livewire:navigating",t),window.addEventListener("popstate",t),window.addEventListener("pageshow",t)})(); diff --git a/resources/js/app.js b/resources/js/app.js index 190d74a..c677864 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1 +1,2 @@ -import './__modals' \ No newline at end of file +import './__modals' +import './__close-dropdowns-on-navigate' \ No newline at end of file diff --git a/resources/views/components/nav/menu-item.blade.php b/resources/views/components/nav/menu-item.blade.php index fda6151..8f1fbde 100644 --- a/resources/views/components/nav/menu-item.blade.php +++ b/resources/views/components/nav/menu-item.blade.php @@ -1,6 +1,13 @@ @props([ 'label' => '', 'link' => null, + 'useNavigate' => true ]) -