mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-31 19:12:44 +00:00
(js) Respect SearchMinWordLength in list editor
More precisely, the domain default is named SOGoSearchMinimumWordLength.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
CardController.$inject = ['$scope', '$timeout', '$window', '$mdDialog', 'AddressBook', 'Card', 'Dialog', 'sgHotkeys', 'sgFocus', '$state', '$stateParams', 'stateCard'];
|
||||
function CardController($scope, $timeout, $window, $mdDialog, AddressBook, Card, Dialog, sgHotkeys, focus, $state, $stateParams, stateCard) {
|
||||
var vm = this, hotkeys = [];
|
||||
var vm = this, hotkeys = [], minSearchLength;
|
||||
|
||||
vm.card = stateCard;
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
vm.toggleRawSource = toggleRawSource;
|
||||
vm.showRawSource = false;
|
||||
|
||||
minSearchLength = angular.isNumber($window.minimumSearchLength)? $window.minimumSearchLength : 2;
|
||||
|
||||
|
||||
_registerHotkeys(hotkeys);
|
||||
|
||||
@@ -98,6 +100,9 @@
|
||||
focus('address_' + i);
|
||||
}
|
||||
function userFilter($query, excludedCards) {
|
||||
if ($query.length < minSearchLength)
|
||||
return [];
|
||||
|
||||
AddressBook.selectedFolder.$filter($query, {dry: true, excludeLists: true}, excludedCards);
|
||||
return AddressBook.selectedFolder.$$cards;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user