scroll to top when finish searching

This commit is contained in:
Listen 1 2017-12-16 14:55:44 +08:00
parent 560ac7ab4e
commit 26058c3d4b

View File

@ -967,13 +967,15 @@
});
function performSearch(){
loWeb.get('/search?source=' + getSourceName($scope.tab) + '&keywords=' + $scope.keywords+'&curpage='+ $scope.curpage).success(function(data) {
// update the textarea
$scope.result = data.result;
updateTotalPage(data.total);
$scope.loading = false;
});
}
loWeb.get('/search?source=' + getSourceName($scope.tab) + '&keywords=' + $scope.keywords+'&curpage='+ $scope.curpage).success(function(data) {
// update the textarea
$scope.result = data.result;
updateTotalPage(data.total);
$scope.loading = false;
// scroll back to top when finish searching
$('.site-wrapper-innerd').scrollTop(0);
});
}
function updateCurrentPage(cp){
if(cp === -1){ // when search words changes,pagenums should be reset.