diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-03-10 15:41:23 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-03-10 15:41:23 +0300 |
commit | ec52d5b14f761170cce24fa9f34b1f24f87043d3 (patch) | |
tree | 848908fb51a55cbe8b8d96c372cfc2c9d5bb5a82 /app/assets/javascripts/projects_list.js.coffee | |
parent | 491ac7ce4b79c901e23799d2062f9f013f08c6c3 (diff) |
Fix projects pagination via ajax
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/assets/javascripts/projects_list.js.coffee')
-rw-r--r-- | app/assets/javascripts/projects_list.js.coffee | 6 |
1 files changed, 6 insertions, 0 deletions
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) + ) |