{I" class:EFI"ProcessedAsset;FI"logical_path;FI"!rails_admin/ra.filter-box.js;TI" pathname;FI"e/Users/sferik/Projects/Ruby/gems/rails_admin/app/assets/javascripts/rails_admin/ra.filter-box.js;TI"content_type;FI"application/javascript;FI" mtime;Fl+ÇØÌQI" length;Fi'I" digest;F"%56deb11e8e6a36dc9990da4f9042903dI" source;FI"'(function($) { var filters; $.filters = filters = { options: { regional: { datePicker: { dateFormat: 'mm/dd/yy' } } }, append: function(field_label, field_name, field_type, field_value, field_operator, field_options, index) { var value_name = 'f[' + field_name + '][' + index + '][v]'; var operator_name = 'f[' + field_name + '][' + index + '][o]'; switch(field_type) { case 'boolean': var control = ''; break; case 'date': case 'datetime': case 'timestamp': var control = '' var additional_control = ' ' + ' ' + ''; break; case 'enum': var multiple_values = ((field_value instanceof Array) ? true : false) var control = '' + ' ' + ''; break; case 'string': case 'text': case 'belongs_to_association': var control = '' var additional_control = ' '; break; case 'integer': case 'decimal': case 'float': var control = '' var additional_control = ' ' + ' ' + ''; break; default: var control = ' '; break; } var content = ' '; $('#filters_box').append(content); $('#filters_box .date').datepicker(this.options.regional.datePicker); $("hr.filters_box:hidden").show('slow'); } } $(document).on('click', "#filters a", function(e) { e.preventDefault(); $.filters.append( $(this).data('field-label'), $(this).data('field-name'), $(this).data('field-type'), $(this).data('field-value'), $(this).data('field-operator'), $(this).data('field-options'), $.now().toString().slice(6,11) ); }); $(document).on('click', "#filters_box .delete", function(e) { e.preventDefault(); form = $(this).parents('form'); $(this).parents('.filter').remove(); !$("#filters_box").children().length && $("hr.filters_box:visible").hide('slow'); }); $(document).on('click', "#filters_box .switch-select", function(e) { e.preventDefault(); var selected_select = $(this).siblings('select:visible'); var not_selected_select = $(this).siblings('select:hidden'); not_selected_select.attr('name', not_selected_select.data('name')).show('slow'); selected_select.attr('name', null).hide('slow'); $(this).find('i').toggleClass("icon-plus icon-minus") }); $(document).on('change', "#filters_box .switch-additionnal-fieldsets", function(e) { var selected_option = $(this).find('option:selected'); if(klass = $(selected_option).data('additional-fieldset')) { $(this).siblings('.additional-fieldset:not(.' + klass + ')').hide('slow'); $(this).siblings('.' + klass).show('slow'); } else { $(this).siblings('.additional-fieldset').hide('slow'); } }); })( jQuery ); ;TI"dependency_digest;F"%6e7df8efb475d3f1f9d1928105fd4974I"required_paths;F[I"e/Users/sferik/Projects/Ruby/gems/rails_admin/app/assets/javascripts/rails_admin/ra.filter-box.js;TI"dependency_paths;F[{I" path;FI"e/Users/sferik/Projects/Ruby/gems/rails_admin/app/assets/javascripts/rails_admin/ra.filter-box.js;TI" mtime;FI"2013-06-28T02:28:55+02:00;FI" digest;F"%56deb11e8e6a36dc9990da4f9042903dI" _version;F"%f9a10b06158d64a75654a1ef72ec0ff4