Sha256: 54139eb51c7ee0f22908a62af3d66d43e341bf6d39ff515a99c060a8a1cbb221
Contents?: true
Size: 1013 Bytes
Versions: 32
Compression:
Stored size: 1013 Bytes
Contents
<div id="filter_bar"> <label> <h3><%= local_assigns[:label] || Alchemy.t('Filter') %></h3> <%= select_tag( 'resource_filter', options_for_select( resource_filter_select, search_filter_params[:filter] ), include_blank: Alchemy.t(:all, scope: ['resources', resource_name, 'filters']), data: { remote: !!request.xhr? }, class: 'alchemy_selectbox' ) %> </label> </div> <script type="text/javascript"> $(function() { $('#resource_filter').on('change', function(e) { var $this = $(this); var url = '<%= local_assigns[:url] || resources_path(resource_handler.namespaced_resources_name, search_filter_params.except(:filter).to_h) %>'; if ($this.data('remote') === true) { $.get(url, {filter: $this.val()}, null, 'script'); } else { delimiter = url.match(/\?/) ? '&' : '?'; Turbolinks.visit(url + delimiter + 'filter=' + encodeURIComponent($this.val())); } return false; }); }); </script>
Version data entries
32 entries across 32 versions & 1 rubygems