From ec52d5b14f761170cce24fa9f34b1f24f87043d3 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 10 Mar 2016 13:41:23 +0100 Subject: [PATCH] Fix projects pagination via ajax Signed-off-by: Dmitriy Zaporozhets --- app/assets/javascripts/projects_list.js.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/javascripts/projects_list.js.coffee b/app/assets/javascripts/projects_list.js.coffee index ed5206368ce..a0d7dc80afc 100644 --- a/app/assets/javascripts/projects_list.js.coffee +++ b/app/assets/javascripts/projects_list.js.coffee @@ -2,6 +2,7 @@ init: -> $(".projects-list-filter").off('keyup') this.initSearch() + this.initPagination() initSearch: -> @timer = null @@ -29,3 +30,8 @@ # Change url so if user reload a page - search results are saved history.replaceState {page: project_filter_url}, document.title, project_filter_url dataType: "json" + + initPagination: -> + $('.projects-list-holder .pagination').bind('ajax:success', (e, data) -> + $('.projects-list-holder').replaceWith(data.html) + )