Sha256: 8ae52236ca65ed3f4dd2a525a1b5b35dbaccda10f131f4f197894996ba72d574
Contents?: true
Size: 987 Bytes
Versions: 16
Compression:
Stored size: 987 Bytes
Contents
<% params_to_keep = [:tagged_with, :q, :content_id, :options] %> <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(merge_params_only(params_to_keep)).html_safe %>'; 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
16 entries across 16 versions & 1 rubygems