- md5
- 0d4ae956278d0ab37d5bc47ae09e1de6
- sha1
- d774aa46e1f969f094b61680a9bf7455039ca62f
- sha256
- 17c6012771df35c3fa2a532d3b7c2a9838dc27470ac12a42cb2c15f42fdd9ca1
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=[].slice.call(a.querySelectorAll("[name=\"order[]\"]")),g=[].slice.call(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[]=${encodeURIComponent(c)}`),e.push(`cid[]=${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-beta to 4.0.0-beta2. See them all, or every version of this file.