mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-21 15:02:40 +00:00
refactor(js): improve defintion of some controllers
This commit is contained in:
1 parent
5c0d8c11da
commit
0cf025b0af
2 files changed
+26
-28
No files matched your search
@@ -135,18 +135,18 @@
|
||||
}
|
||||
|
||||
// Method to call on data changes
|
||||
vm.onChange = function() {
|
||||
var form = $scope[vm.formName],
|
||||
input = form[vm.inputName],
|
||||
this.onChange = function() {
|
||||
var form = $scope[this.formName],
|
||||
input = form[this.inputName],
|
||||
rawSearchText = input.$viewValue;
|
||||
|
||||
if (vm.allowDot && rawSearchText == '.' || form.$valid && rawSearchText) {
|
||||
if (this.allowDot && rawSearchText == '.' || form.$valid && rawSearchText) {
|
||||
if (rawSearchText == '.')
|
||||
// Ignore the minlength constraint when using the dot operator
|
||||
input.$setValidity('minlength', true);
|
||||
|
||||
// doSearch is the compiled expression of the sg-search attribute
|
||||
vm.doSearch($scope, { searchText: rawSearchText, searchField: vm.searchField });
|
||||
this.doSearch($scope, { searchText: rawSearchText, searchField: this.searchField });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user