From 32dbe3f86ab4b1a95eca74a5fa97a5ae587a21e1 Mon Sep 17 00:00:00 2001 From: Vismay Golwala Date: Tue, 5 Mar 2019 21:19:40 -0500 Subject: [PATCH] UI - scroll to top in pagination Currently in pagination, when we switch from one page to another, the view is stuck at the bottom and is slightly inconvenient to scroll all the way to top, in potentially a large list of records. So in order to prevent that, this commit sets automatic scroll to top while switching between pages, using jQuery's animate and scrollTop methods. Signed-off-by: Vismay Golwala --- awx/ui/client/src/shared/paginate/paginate.controller.js | 1 + 1 file changed, 1 insertion(+) diff --git a/awx/ui/client/src/shared/paginate/paginate.controller.js b/awx/ui/client/src/shared/paginate/paginate.controller.js index 6da86f4880..a50e18ed1f 100644 --- a/awx/ui/client/src/shared/paginate/paginate.controller.js +++ b/awx/ui/client/src/shared/paginate/paginate.controller.js @@ -57,6 +57,7 @@ export default ['$scope', '$stateParams', '$state', '$filter', 'GetBasePath', 'Q $scope.collection = res.data.results; $scope.$emit('updateDataset', res.data); }); + $('html, body').animate({scrollTop: 0}, 0); }; function calcLast() {