chore(docs/search): ensure that default search goes to API first

Closes #9736
This commit is contained in:
Peter Bacon Darwin
2014-10-25 09:39:01 +02:00
parent 2cd5b4ec44
commit 54ddca537e

View File

@@ -41,10 +41,14 @@ angular.module('search', [])
$scope.submit = function() {
var result;
for(var i in $scope.results) {
result = $scope.results[i][0];
if(result) {
break;
if ($scope.results.api) {
result = $scope.results.api[0];
} else {
for(var i in $scope.results) {
result = $scope.results[i][0];
if(result) {
break;
}
}
}
if(result) {