mirror of
https://github.com/pelican-dev/panel.git
synced 2025-10-14 19:56:50 +02:00
2 lines
873 B
JavaScript
2 lines
873 B
JavaScript
(()=>{var i=({livewireId:n})=>({actionNestingIndex:null,init:function(){window.addEventListener("sync-action-modals",t=>{t.detail.id===n&&this.syncActionModals(t.detail.newActionNestingIndex)})},syncActionModals:function(t){if(this.actionNestingIndex!==t&&(this.actionNestingIndex!==null&&this.closeModal(),this.actionNestingIndex=t,this.actionNestingIndex!==null)){if(!this.$el.querySelector(`#${this.generateModalId(t)}`)){this.$nextTick(()=>this.openModal());return}this.openModal()}},generateModalId:function(t){return`fi-${n}-action-`+t},openModal:function(){let t=this.generateModalId(this.actionNestingIndex);this.$dispatch("open-modal",{id:t})},closeModal:function(){let t=this.generateModalId(this.actionNestingIndex);this.$dispatch("close-modal-quietly",{id:t})}});document.addEventListener("alpine:init",()=>{window.Alpine.data("filamentActionModals",i)});})();
|