-
-
Notifications
You must be signed in to change notification settings - Fork 532
Open
Labels
Description
The results for the document title typeahead search are most of the time not what I was expecting. So I changed the sort order to descending, the sort column to 3 and the limit to 10 in DocumentEdit.js. It is much better now, as it offers the latest documents matching the typed text.
/**
* Returns a promise for typeahead title.
*/
$scope.getTitleTypeahead = function($viewValue) {
var deferred = $q.defer();
Restangular.one('document/list')
.get({
limit: 10,
sort_column: 3,
asc: false,
search: $viewValue
}).then(function(data) {
deferred.resolve(_.uniq(_.pluck(data.documents, 'title'), true));
});
return deferred.promise;
};