Sha256: 826a85c07c5b5881e98453974c71390b71da3afea3a77baf1aaf65d96a134a14
Contents?: true
Size: 721 Bytes
Versions: 52
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
52 entries across 52 versions & 2 rubygems