CoreFiles by mySites.guru
draggable.min.js1 lines, 1,792 bytes, from Joomla_4.0.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 3.10.0-alpha9
md5
23822e3b822e630a0b838bced36c350e
sha1
5b67d8f02cb156d94ced6c64d551268d68d84388
sha256
15ca3f430ca1b56d84ef3674b527fb8f803016bf4e5b84ddb3b96bbce7ad31bb
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,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-alpha2 to 4.0.0-alpha6. See them all, or every version of this file.