From ceedefec54b7f7a50308b07a2697a81ef1752fc8 Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Thu, 8 Jun 2017 03:09:37 -0500 Subject: [PATCH] Update URL when paginating groups --- app/assets/javascripts/groups/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/groups/index.js b/app/assets/javascripts/groups/index.js index 508590f8676..5b7018153bf 100644 --- a/app/assets/javascripts/groups/index.js +++ b/app/assets/javascripts/groups/index.js @@ -94,7 +94,12 @@ document.addEventListener('DOMContentLoaded', () => { this.isLoading = false; $.scrollTo(0); - this.updateGroups(response.json()); + const currentPath = gl.utils.mergeUrlParams({ page: page }, window.location.href); + window.history.replaceState({ + page: currentPath, + }, document.title, currentPath); + + this.updateGroups(response.json()); this.updatePagination(response.headers); }) .catch(this.handleErrorResponse);