templates/includes/ebooks-sort-select.html.twig line 1

Open in your IDE?
  1. <div class="column" style="margin-left:auto;">
  2.     <select class="form-control" id="ebooks-select">
  3.         <option class="form-control" id="eb-part" value="/partner-ebooks">Sort by Partner</option>
  4.         <option class="form-control" id="eb-cat" value="/ebooks">Sort by Category</option>
  5.         <option class="form-control" id="eb-cat" value="/category/ebooks/downloads">Downloads</option>
  6.     </select>
  7. </div>
  8. <script>
  9.     $( document ).ready(() => {
  10.         $('#ebooks-select').val(window.location.pathname)
  11.     });
  12.     $('#ebooks-select').on('change', (e)=>{
  13.         if(e.target.value != window.location.pathname){
  14.             window.location.replace(e.target.value);
  15.         }
  16.     })
  17. </script>