Sha256: 500824e4ed1d16b2e44899dd20416d2d02a643fb54588f31235252fbb1928665

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

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

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

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

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

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

  $("#searchtext").delayedObserver(function() {
    search_for_products();
  }, 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/products/selected_for_question.html.erb
spree_grid_faq-0.0.9 app/views/spree/admin/products/selected_for_question.html.erb
spree_grid_faq-0.0.8 app/views/spree/admin/products/selected_for_question.html.erb
spree_grid_faq-0.0.7 app/views/spree/admin/products/selected_for_question.html.erb