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:
Mark Walker 2015-07-07 23:24:27 +02:00 committed by Gina Häußge
parent abbf937e7f
commit 677e583345

View file

@ -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) {