Sha256: eb4c02d43a4ed656c7185d40445beeb30ecc0b314a593cc57c5da82cdf12239a
Contents?: true
Size: 831 Bytes
Versions: 7
Compression:
Stored size: 831 Bytes
Contents
function initListing() { $ = document.querySelector.bind(document); function applySort(sortable) { var params = new URLSearchParams(location.search.slice(1)); params.set("_servel_sort_method", sortable.dataset.sortMethod); params.set("_servel_sort_direction", sortable.dataset.sortDirection); if('sortActive' in sortable.dataset) { params.set("_servel_sort_direction", sortable.dataset.sortDirection == "asc" ? "desc" : "asc"); } location.href = location.pathname + "?" + params.toString(); } document.body.addEventListener("click", function(e) { if(!e.target) return; if(e.target.closest("th.sortable")) { e.preventDefault(); applySort(e.target.closest("th.sortable")); } }); } window.addEventListener("DOMContentLoaded", initListing);
Version data entries
7 entries across 7 versions & 1 rubygems