CoreFiles by mySites.guru
multiselect.es6.min.js1 lines, 2,277 bytes, from Joomla_4.0.0-alpha10-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha9
md5
d92c6a0bfeeb0a322b7e2d8ef4317af4
sha1
c84f230b03aa2d62dfc4e0d273dc35a55d4d5d22
sha256
d0b6ef394b8657557b4c07a53af6d93f5bd253b56e60d46d0ff32a5009f5913f
function getClosest(a,b){const c=b.toUpperCase();let d=a;do{if(d.nodeName===c)return d;d=d.parentNode}while(null!=d);return null}(a=>{'use strict';class b{constructor(a){this.tableEl=document.querySelector(a),this.tableEl&&(this.boxes=[].slice.call(this.tableEl.querySelectorAll("input[type=checkbox]")),this.rows=[].slice.call(document.querySelectorAll("tr[class^=\"row\"]")),this.checkallToggle=document.querySelector("[name=\"checkall-toggle\"]"),this.onCheckallToggleClick=this.onCheckallToggleClick.bind(this),this.onRowClick=this.onRowClick.bind(this),this.checkallToggle&&this.checkallToggle.addEventListener("click",this.onCheckallToggleClick),this.rows.length&&this.rows.forEach(a=>{a.addEventListener("click",this.onRowClick)}))}changeBg(a,b){b?[].slice.call(a.querySelectorAll("td, th")).forEach(a=>{a.classList.add("row-selected")}):[].slice.call(a.querySelectorAll("td, th")).forEach(a=>{a.classList.remove("row-selected")})}onCheckallToggleClick(a){const b=a.target.checked;this.rows.forEach(a=>{this.changeBg(a,b)})}onRowClick(b){if(b.target.tagName&&("a"===b.target.tagName.toLowerCase()||"button"===b.target.tagName.toLowerCase()))return;if(!this.boxes.length)return;const c=this.rows.indexOf(-1<navigator.userAgent.indexOf("MSIE ")||-1<navigator.userAgent.indexOf("Trident/")?getClosest(b.target,"tr"):b.target.closest("tr")),d=this.checkallToggle?c+1:c;let e=this.boxes[d].checked;0<=d&&(b.target.id!==this.boxes[d].id&&(b.shiftKey&&(document.body.style["-webkit-user-select"]="none",document.body.style["-moz-user-select"]="none",document.body.style["-ms-user-select"]="none",document.body.style["user-select"]="none"),this.boxes[d].checked=!this.boxes[d].checked,e=this.boxes[d].checked,a.isChecked(this.boxes[d].checked,this.tableEl.id)),this.changeBg(this.rows[d-1],e),b.shiftKey&&(document.body.style["-webkit-user-select"]="none",document.body.style["-moz-user-select"]="none",document.body.style["-ms-user-select"]="none",document.body.style["user-select"]="none"))}}document.addEventListener("DOMContentLoaded",()=>{a?a.getOptions&&"function"==typeof a.getOptions&&a.getOptions("js-multiselect")&&(a.getOptions("js-multiselect").formName?new b("#".concat(a.getOptions("js-multiselect").formName)):new b("#adminForm")):new b("#adminForm")})})(Joomla);

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