CoreFiles by mySites.guru
draggable.es6.min.js1 lines, 1,723 bytes, from Joomla_4.0.0-alpha12-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha11
md5
1d16174ef6a7ee6e29af074d52a92844
sha1
98e0e7105429319d017756c2452a16acb8b4cebb
sha256
d51e5ed34757150bd8d8ac06138e75e3c580eb0be6cd5ca46494b9b9fc84632c
document.addEventListener("DOMContentLoaded",()=>{'use strict';let a,b,c,d=document.querySelector(".js-draggable");const e=d.querySelectorAll("[name=\"order[]\"]");if(d)a=d.getAttribute("data-url"),b=d.getAttribute("data-direction"),c=d.getAttribute("data-nested");else if(Joomla.getOptions("draggable-list")){const e=Joomla.getOptions("draggable-list");d=document.querySelector(e.id),d.classList.contains("js-draggable")||d.classList.add("js-draggable"),({url:a}=e),({direction:b}=e),c=e.nested}if(d){for(let a=0,b=e.length;b>a;a+=1)e[a].setAttribute("data-order",a+1);document.addEventListener("touchstart",()=>{},!1);const f=(a,b)=>{let c,d;const e=[],f=a.querySelectorAll("[name=\"order[]\"]"),g=a.querySelectorAll("[name=\"cid[]\"]");for("desc"===b&&(f.reverse(),g.reverse()),c=0,d=f.length;d>c;c+=1)f[c].value=c+1,e.push("order[]=".concat(encodeURIComponent(c))),e.push("cid[]=".concat(encodeURIComponent(g[c].value)));return e};dragula([d],{direction:"vertical",copy:!1,revertOnSpill:!0,accepts(a,b,d,e){return c?null===e?null==e||e&&"tr"===e.tagName.toLowerCase():e.getAttribute("data-dragable-group")&&e.getAttribute("data-dragable-group")===a.getAttribute("data-dragable-group"):null===e||e&&"tr"===e.tagName.toLowerCase()}}).on("drag",()=>{}).on("cloned",()=>{const a=document.querySelector(".gu-mirror");a.classList.add("table")}).on("drop",()=>{if(a){const c=document.querySelector("[name=\"task\"]");c&&c.setAttribute("name","some__Temporary__Name__");const e={url:a,method:"POST",data:f(d,b).join("&"),perform:!0};Joomla.request(e),c&&c.setAttribute("name","task")}}).on("dragend",()=>{const a=d.querySelectorAll("[name=\"order[]\"]");for(let b=0,c=a.length;c>b;b+=1)a[b].setAttribute("data-order",b+1)})}});

The same content is in 2 releases, Joomla 4.0.0-alpha11 to 4.0.0-alpha12. See them all, or every version of this file.