Sha256: e50511650a224b28da34942cd9423a171f19186d09979fa64c4477414c542349
Contents?: true
Size: 899 Bytes
Versions: 77
Compression:
Stored size: 899 Bytes
Contents
<div id="filter_bar"> <h3><%= Alchemy.t('Filter') %></h3> <%= select_tag( 'file_type_filter', options_for_select( Alchemy::Attachment.file_types_for_select, search_filter_params[:file_type] ), include_blank: Alchemy.t('Show all files'), data: { remote: !!request.xhr? }, class: 'alchemy_selectbox' ) %> </div> <script type="text/javascript"> $(function() { $('#file_type_filter').on('change', function(e) { var $this = $(this); var url = '<%= alchemy.admin_attachments_path(search_filter_params.except(:file_type).to_h) %>'; if ($this.data('remote') === true) { $.get(url, {file_type: $this.val()}, null, 'script'); } else { delimiter = url.match(/\?/) ? '&' : '?'; Turbolinks.visit(url + delimiter + 'file_type=' + encodeURIComponent($this.val())); } return false; }); }); </script>
Version data entries
77 entries across 77 versions & 1 rubygems