(js) Fix possible errors (help from jsjint)

This commit is contained in:
Francis Lachapelle
2015-07-24 16:14:53 -04:00
parent e064dc4a46
commit dc9a0896e5
27 changed files with 166 additions and 157 deletions
@@ -1,6 +1,7 @@
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
(function() {
/* jshint validthis: true */
'use strict';
/*
@@ -66,7 +67,7 @@
if (buttonEl && compiledButtonEl) {
compiledButtonEl.on('click', controller.cancelSearch);
}
}
};
}
}
@@ -83,7 +84,7 @@
transclude(function(clone) {
iElement.append(clone);
});
}
};
}
}
@@ -109,9 +110,9 @@
// Method to call on data changes
vm.onChange = function() {
if (vm.searchText != null) {
if (vm.searchText !== null) {
if (vm.searchText != vm.previous.searchText || vm.searchField != vm.previous.searchField) {
if (vm.searchText.length > 2 || vm.searchText.length == 0) {
if (vm.searchText.length > 2 || vm.searchText.length === 0) {
// doSearch is the compiled expression of the sg-search attribute
vm.doSearch($scope, { searchText: vm.searchText, searchField: vm.searchField });
}