Sha256: e7b23e26a84d3c6e27994a398699b133434043289e257aa4390f4594f03c103f
Contents?: true
Size: 1.71 KB
Versions: 35
Compression:
Stored size: 1.71 KB
Contents
<% live_search = active_scaffold_config.search.live? -%> <% url_options = params_for(:action => :index, :escape => false).delete_if{|k,v| k == 'search'} -%> <%= options = {:id => element_form_id(:action => 'search'), :class => "as_form search", :remote => true, :method => :get, 'data-as_load' => 'form', 'data-as_action' => 'search' } options['data-loading'] = true unless live_search form_tag url_options, options %> <%= text_field_tag :search, search_params, :class => 'text-input', :id => search_input_id, :size => 50, :autocomplete => :off %> <%= submit_tag as_(:search), :class => "submit" %> <%= link_to as_(:reset), url_for(url_options.merge(:search => '')), :class => 'as_cancel', :remote => true %> <%= loading_indicator_tag(:action => :search) %> </form> <script type="text/javascript"> //<![CDATA[ <% if ActiveScaffold.js_framework == :prototype %> new TextFieldWithExample('<%= search_input_id %>', '<%= as_(live_search ? :live_search : :search_terms) %>', {focus: true}); <% end -%> <% if live_search && ActiveScaffold.js_framework == :prototype -%> $(<%= search_input_id.to_json.html_safe %>).next().hide(); new Form.Element.DelayedObserver('<%= search_input_id %>', 0.5, function(element, value) { if (!$(element.id)) return false; // because the element may have been destroyed $(element).next().click(); }); <% elsif live_search && ActiveScaffold.js_framework == :jquery %> $(<%= "##{search_input_id}".to_json.html_safe %>).next().hide(); $(<%= "##{search_input_id}".to_json.html_safe %>).delayedObserver(0.5, function() { $(<%= "##{search_input_id}".to_json.html_safe %>).parent().trigger("submit");}); <% end -%> //]]> </script>
Version data entries
35 entries across 35 versions & 1 rubygems