Sha256: 553b580c81577b8f62c29fe54d99dafcd993d4ae3e0c400c0b173b5131d4bf59
Contents?: true
Size: 721 Bytes
Versions: 29
Compression:
Stored size: 721 Bytes
Contents
// = require_self $(() => { const { pushState, registerCallback } = window.Decidim.History; $(document).on("click", ".order-by a", (event) => { const $target = $(event.target); $target.parents(".menu").find("a:first").text($target.text()); pushState($target.attr("href")); }) registerCallback("orders", () => { const url = window.location.toString(); const match = url.match(/order=([^&]*)/); const $orderMenu = $(".order-by .menu"); let order = $orderMenu.find(".menu a:first").data("order"); if (match) { order = match[1]; } const linkText = $orderMenu.find(`.menu a[data-order="${order}"]`).text(); $orderMenu.find("a:first").text(linkText); }); });
Version data entries
29 entries across 29 versions & 1 rubygems