Sha256: 5b02c8ee9e3bc161e07bd645235ae84b9a198b840381702f973dea1869eee35e
Contents?: true
Size: 922 Bytes
Versions: 9
Compression:
Stored size: 922 Bytes
Contents
<div id="filter_bar"> <h2><%= Alchemy.t('Filter') %></h2> <%= select_tag( 'file_type_filter', options_for_select( Alchemy::Attachment.file_types_for_select, 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 { Alchemy.pleaseWaitOverlay(); delimiter = url.match(/\?/) ? '&' : '?'; window.location = url + delimiter + 'file_type=' + encodeURIComponent($this.val()); } return false; }); }); </script>
Version data entries
9 entries across 9 versions & 1 rubygems