Skip to content

Commit

Permalink
fix init event-listener
Browse files Browse the repository at this point in the history
  • Loading branch information
MoamenEltouny committed Jul 10, 2022
1 parent f7c9751 commit 9fdcd65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/pharaonic.tagify.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion resources/views/components/scripts.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<script>
if(void 0===Pharaonic)var Pharaonic={};var PharaonicTagify={Tagify:{init:function(){document.querySelectorAll('[data-pharaonic="tagify"]').forEach((a=>{a.previousElementSibling&&"TAGS"==a.previousElementSibling.tagName||!a.dataset.componentId||Pharaonic.Tagify.load(a,a.dataset.componentId)}))},load:function(a,e){var t=a.dataset.value?a.dataset.value:"value",i=a.dataset.key?a.dataset.key:"value",n=a.hasAttribute("data-direct"),s=""!=a.defaultValue?a.defaultValue:[];s.length>0&&(s=JSON.parse(s));var d={whitelist:a.dataset.suggestList?JSON.parse(a.dataset.suggestList):[],blacklist:a.dataset.blackList?JSON.parse(a.dataset.blackList):[],enforceWhitelist:!!a.hasAttribute("data-suggest-enforce"),maxTags:a.dataset.max?a.dataset.max:1/0,tagTextProp:t,dropdown:{maxItems:25,classname:a.dataset.classname?a.dataset.classname:"",enabled:a.hasAttribute("data-suggest")||a.hasAttribute("data-suggest-enforce")?0:1,closeOnSelect:!1,mapValueTo:t,searchKeys:[t]}};if(a.hasAttribute("data-pattern")&&(d.pattern=a.getAttribute("data-pattern")),r=a.attributes,l=r.getNamedItem("wire:model")||r.getNamedItem("wire:model.defer")||null,delete r,(a=new Tagify(a,d)).addTags(s),l){var o=l.value,c=l.name.search("defer")>0;a.on("change",(a=>{(a=""==(a=a.detail.value)?[]:JSON.parse(a)).length>0&&n&&(a=a.map((a=>a[i]))),Livewire.find(e).set(o,a,c)}))}}}};Object.assign(Pharaonic,PharaonicTagify),window.addEventListener("DOMContentLoaded",(()=>{Pharaonic.Tagify.init()})),window.addEventListener("pharaonic.tagify.init",(a=>{Pharaonic.Tagify.init()})),window.addEventListener("pharaonic.tagify.load",(a=>{Pharaonic.Tagify.load(document.querySelector(a.detail.target),a.detail.component)}));
if(void 0===Pharaonic)var Pharaonic={};var PharaonicTagify={Tagify:{init:function(){document.querySelectorAll('[data-pharaonic="tagify"]').forEach((a=>{a.previousElementSibling&&"TAGS"==a.previousElementSibling.tagName||!a.dataset.componentId||Pharaonic.Tagify.load(a,a.dataset.componentId)}))},load:function(a,e){var t=a.dataset.value?a.dataset.value:"value",i=a.dataset.key?a.dataset.key:"value",n=a.hasAttribute("data-direct"),s=""!=a.defaultValue?a.defaultValue:[];s.length>0&&(s=JSON.parse(s));var d={whitelist:a.dataset.suggestList?JSON.parse(a.dataset.suggestList):[],blacklist:a.dataset.blackList?JSON.parse(a.dataset.blackList):[],enforceWhitelist:!!a.hasAttribute("data-suggest-enforce"),maxTags:a.dataset.max?a.dataset.max:1/0,tagTextProp:t,dropdown:{maxItems:25,classname:a.dataset.classname?a.dataset.classname:"",enabled:a.hasAttribute("data-suggest")||a.hasAttribute("data-suggest-enforce")?0:1,closeOnSelect:!1,mapValueTo:t,searchKeys:[t]}},r=a.attributes,o=r.getNamedItem("wire:model")||r.getNamedItem("wire:model.defer")||null;if(delete r,(a=new Tagify(a,d)).addTags(s),o){var l=o.value,c=o.name.search("defer")>0;a.on("change",(a=>{(a=""==(a=a.detail.value)?[]:JSON.parse(a)).length>0&&n&&(a=a.map((a=>a[i]))),Livewire.find(e).set(l,a,c)}))}}}};Object.assign(Pharaonic,PharaonicTagify),window.addEventListener("DOMContentLoaded",(()=>{Pharaonic.Tagify.init()})),window.addEventListener("pharaonic.tagify.init",(a=>{Pharaonic.Tagify.init()})),window.addEventListener("pharaonic.tagify.load",(a=>{Pharaonic.Tagify.load(document.querySelector(a.detail.target),a.detail.component)}));
</script>

0 comments on commit 9fdcd65

Please sign in to comment.