Sha256: 273371ad0d8d3ebe1158d7cfdd0c852f9e95f2b7a7d21a89d1872c8af3c52b96
Contents?: true
Size: 992 Bytes
Versions: 16
Compression:
Stored size: 992 Bytes
Contents
<% params_to_keep = [:tagged_with, :q] %> <div id="filter_bar"> <h2><%= Alchemy.t('Filter') %></h2> <%= select_tag( 'resource_filter', options_for_select( resource_filter_select, params[:filter] ), include_blank: Alchemy.t(:all, scope: ['resources', resource_name, 'filters']), data: { remote: !!request.xhr? }, class: 'alchemy_selectbox' ) %> </div> <script type="text/javascript"> $(function() { $('#resource_filter').on('change', function(e) { var $this = $(this); var url = '<%= resources_path(resource_handler.namespaced_resources_name, merge_params_only(params_to_keep)).html_safe %>'; if ($this.data('remote') === true) { $.get(url, {filter: $this.val()}, null, 'script'); } else { Alchemy.pleaseWaitOverlay(); delimiter = url.match(/\?/) ? '&' : '?'; window.location = url + delimiter + 'filter=' + encodeURIComponent($this.val()); } return false; }); }); </script>
Version data entries
16 entries across 16 versions & 1 rubygems