Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/app/views/orders/index.js.erb b/app/views/orders/index.js.erb
- index 439f038..9888fbd 100644
- --- a/app/views/orders/index.js.erb
- +++ b/app/views/orders/index.js.erb
- @@ -1,3 +1,16 @@
- $("#order_lis_container").html("<%= escape_javascript(render partial: 'orders/list_orders',locals: {orders: @orders} ) %>");
- -$('.pagination').replaceWith('<%= j paginate(@orders) %>');
- \ No newline at end of file
- +<% data = j paginate(@orders) %>
- +<% if data.blank? %>
- + $('.pagination').hide();
- +<% else %>
- + $('.pagination').show();
- + $('.pagination').replaceWith('<%= data %>');
- +<% end %>
- +
- +$(".paginate_collection a").click(function(e){
- + e.preventDefault();
- + var thisObj = $(this);
- + $("#page").val( parseInt($.trim(thisObj.text())) || parseInt($.trim(getUrlParameter('page',thisObj.attr("href")))) || "");
- + $("#search_form").submit();
- +});
- \ No newline at end of file
Add Comment
Please, Sign In to add comment