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 <vgolwala@redhat.com>
This commit is contained in:
Vismay Golwala 2019-03-05 21:19:40 -05:00
parent 658bdddac3
commit 32dbe3f86a

View File

@ -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() {