Sha256: b4f160095835f709114c75e8cdf8e9bce2e45fc39b3fc4f06d638b7a4d99233c

Contents?: true

Size: 1021 Bytes

Versions: 4

Compression:

Stored size: 1021 Bytes

Contents

<%= render :partial => 'spree/admin/shared/question_tabs', :locals => { :current => 'Taxons' } %>
<div id="selected-taxons" data-hook>
  <%= render :partial => 'question_taxon_table', :locals => { :taxons => @taxons } %>
</div>

<%= form_tag '#' do %>
  <%= label_tag nil, t(:search) %>:
  <input id="searchtext" size="25">
<% end %>

<%= javascript_tag do %>
  function search_for_taxons(){
    $.ajax({
     data: {q: $("#searchtext").val() },
     dataType: 'html',
     success: function(request){
       jQuery('#search_hits').html(request);
     },
     type: 'POST',
     url: '<%= available_admin_question_taxons_url(@question, :format => 'js') %>'
    });
  }

  $("#searchtext").keypress(function (e) {
    if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
      search_for_taxons();

      return false;
    } else {
       return true;
    }
  });

  $("#searchtext").delayedObserver(function() {
    search_for_taxons();
  }, 0.75);
<% end %>
<br />
<div id="search_hits" data-hook></div>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spree_grid_faq-0.1.0 app/views/spree/admin/taxons/selected_for_question.html.erb
spree_grid_faq-0.0.9 app/views/spree/admin/taxons/selected_for_question.html.erb
spree_grid_faq-0.0.8 app/views/spree/admin/taxons/selected_for_question.html.erb
spree_grid_faq-0.0.7 app/views/spree/admin/taxons/selected_for_question.html.erb