From 26058c3d4b9fc38e0a993e8f586b5597aaeffa62 Mon Sep 17 00:00:00 2001 From: Listen 1 Date: Sat, 16 Dec 2017 14:55:44 +0800 Subject: [PATCH] scroll to top when finish searching --- js/app.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/js/app.js b/js/app.js index 387f359..8dbbd37 100644 --- a/js/app.js +++ b/js/app.js @@ -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.