Skip to content
Snippets Groups Projects
Commit 87eefb2e authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

Wot search : Do not show "no result" when opening lookup modal

parent 061bfad5
No related branches found
No related tags found
No related merge requests found
...@@ -92,7 +92,7 @@ function WotLookupController($scope, $rootScope, BMA, $state, UIUtils, $timeout, ...@@ -92,7 +92,7 @@ function WotLookupController($scope, $rootScope, BMA, $state, UIUtils, $timeout,
$scope.search = { $scope.search = {
text: '', text: '',
loading: true, loading: true,
type: 'newcomers', type: null,
limit: defaultSearchLimit, limit: defaultSearchLimit,
results: [] results: []
}; };
...@@ -160,7 +160,7 @@ function WotLookupController($scope, $rootScope, BMA, $state, UIUtils, $timeout, ...@@ -160,7 +160,7 @@ function WotLookupController($scope, $rootScope, BMA, $state, UIUtils, $timeout,
}; };
$scope.doGetNewcomers= function(limit, more) { $scope.doGetNewcomers= function(limit, more) {
$scope.search.loading = more ? false : true; $scope.search.loading = !more;
$scope.search.type = 'newcomers'; $scope.search.type = 'newcomers';
$scope.search.limit = (limit && limit > 0) ? limit : $scope.search.limit; $scope.search.limit = (limit && limit > 0) ? limit : $scope.search.limit;
var searchFunction = csConfig.initPhase ? var searchFunction = csConfig.initPhase ?
...@@ -176,9 +176,9 @@ function WotLookupController($scope, $rootScope, BMA, $state, UIUtils, $timeout, ...@@ -176,9 +176,9 @@ function WotLookupController($scope, $rootScope, BMA, $state, UIUtils, $timeout,
$scope.search.loading = more ? false : true; $scope.search.loading = more ? false : true;
$scope.search.type = 'pending'; $scope.search.type = 'pending';
$scope.search.limit = (limit && limit > 0) ? limit : $scope.search.limit; $scope.search.limit = (limit && limit > 0) ? limit : $scope.search.limit;
return WotService.pending($scope.search.limit).then(function(res){ return WotService.pending($scope.search.limit).then(function(idties){
if ($scope.search.type != 'pending') return; // could have change if ($scope.search.type != 'pending') return; // could have change
$scope.doDisplayResult(res); $scope.doDisplayResult(idties);
}); });
}; };
...@@ -286,7 +286,6 @@ function WotLookupModalController($scope, $rootScope, BMA, $state, UIUtils, $tim ...@@ -286,7 +286,6 @@ function WotLookupModalController($scope, $rootScope, BMA, $state, UIUtils, $tim
WotLookupController.call(this, $scope, $rootScope, BMA, $state, UIUtils, $timeout, csConfig, csSettings, Device, Wallet, WotService, $focus); WotLookupController.call(this, $scope, $rootScope, BMA, $state, UIUtils, $timeout, csConfig, csSettings, Device, Wallet, WotService, $focus);
$scope.search.loading = false; $scope.search.loading = false;
$scope.search.type='text';
$scope.enableFilter = false; $scope.enableFilter = false;
$scope.wotSearchTextId = 'wotSearchTextModal'; $scope.wotSearchTextId = 'wotSearchTextModal';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment