CoreFiles by mySites.guru
draggable.min.js1 lines, 1,794 bytes, from Joomla_4.0.0-alpha9-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha8
md5
2d5fae7663f048d8d34a922277e79d9c
sha1
617a7486cfbdef603f6984cc389281fa4b335f85
sha256
f5345dbce353bb2e0260a5fbc2ea70864541e13e8b53e93bd2fcdd2806004cc5
document.addEventListener("DOMContentLoaded",function(){"use strict";var e,t,r,a=document.querySelector(".js-draggable"),o=a.querySelectorAll('[name="order[]"]');if(a)e=a.getAttribute("data-url"),t=a.getAttribute("data-direction"),r=a.getAttribute("data-nested");else if(Joomla.getOptions("draggable-list")){var n=Joomla.getOptions("draggable-list");(a=document.querySelector(n.id)).classList.contains("js-draggable")||a.classList.add("js-draggable"),e=n.url,t=n.direction,r=n.nested}if(a){for(var l=0,d=o.length;d>l;l++)o[l].setAttribute("data-order",l+1);document.addEventListener("touchstart",function(){},!1),Array.prototype.move=function(e,t){this.splice(t,0,this.splice(e,1)[0])};dragula([a],{direction:"vertical",copy:!1,revertOnSpill:!0,accepts:function(e,t,a,o){return r&&null!==o?o.getAttribute("data-dragable-group")&&o.getAttribute("data-dragable-group")==e.getAttribute("data-dragable-group"):null===o||o&&"tr"===o.tagName.toLowerCase()}}).on("drag",function(e,t){}).on("cloned",function(e,t){document.querySelector(".gu-mirror").classList.add("table")}).on("drop",function(){if(e){var r=document.querySelector('[name="task"]');r&&r.setAttribute("name","some__Temporary__Name__");var o={url:e,method:"POST",data:function(e,t){var r,a,o=[],n=e.querySelectorAll('[name="order[]"]'),l=e.querySelectorAll('[name="cid[]"]');for("desc"===t&&(n=Array.prototype.slice.call(n),l=Array.prototype.slice.call(l),n.reverse(),l.reverse()),r=0,a=n.length;a>r;r++)n[r].value=r+1,o.push("order[]="+encodeURIComponent(r)),o.push("cid[]="+encodeURIComponent(l[r].value));return o}(a,t).join("&"),perform:!0};Joomla.request(o),r&&r.setAttribute("name","task")}}).on("dragend",function(e){for(var t=a.querySelectorAll('[name="order[]"]'),r=0,o=t.length;o>r;r++)t[r].setAttribute("data-order",r+1)})}});

The same content is in 4 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha10. See them all, or every version of this file.