pluginmanager: case handling and submit binding
- Convert query term to lower case so that it is case insensitive both ways
- Knockout submit binding takes the form element as parameter and return
value determines whether the form submit occurs. See http://knockoutjs.com/documentation/submit-binding.html
(cherry picked from commit 4a2cc53)
This commit is contained in:
parent
abbf937e7f
commit
677e583345
1 changed files with 3 additions and 5 deletions
|
|
@ -147,19 +147,17 @@ $(function() {
|
|||
}
|
||||
});
|
||||
|
||||
self.performRepositorySearch = function(e) {
|
||||
if (e !== undefined) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
self.performRepositorySearch = function(formElement) {
|
||||
var query = self.repositorySearchQuery();
|
||||
if (query !== undefined && query.trim() != "") {
|
||||
query = query.toLocaleLowerCase()
|
||||
self.repositoryplugins.changeSearchFunction(function(entry) {
|
||||
return entry && (entry["title"].toLocaleLowerCase().indexOf(query) > -1 || entry["description"].toLocaleLowerCase().indexOf(query) > -1);
|
||||
});
|
||||
} else {
|
||||
self.repositoryplugins.resetSearch();
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
self.fromResponse = function(data) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue