Skip to content

Commit

Permalink
Merge branch 'cernbox-develop-8.0.2-eosfs' into cernbox-develop-8.0.2…
Browse files Browse the repository at this point in the history
…-integration
  • Loading branch information
Hugo Gonzalez Labrador committed Jul 7, 2015
2 parents 75ea692 + 59fa052 commit 736f902
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions core/search/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,18 @@
});
$searchBox.keyup(function(event) {
if (event.keyCode === 13) { //enter
var query = $searchBox.val();
if (lastQuery !== query) {
currentResult = -1;
if (query.length > 2) {
self.search(query);
} else {
self.hideResults();
}
if(self.hasFilter(getCurrentApp())) {
self.getFilter(getCurrentApp())(query);
}
}
if(currentResult > -1) {
var result = $searchResults.find('tr.result a')[currentResult];
window.location = $(result).attr('href');
Expand All @@ -308,19 +320,6 @@
currentResult++;
renderCurrent();
}
} else {
var query = $searchBox.val();
if (lastQuery !== query) {
currentResult = -1;
if (query.length > 2) {
self.search(query);
} else {
self.hideResults();
}
if(self.hasFilter(getCurrentApp())) {
self.getFilter(getCurrentApp())(query);
}
}
}
});
$(document).keyup(function(event) {
Expand Down Expand Up @@ -383,4 +382,4 @@ OC.search.customResults = {};
/**
* @deprecated use get/setRenderer() instead
*/
OC.search.resultTypes = {};
OC.search.resultTypes = {};

0 comments on commit 736f902

Please sign in to comment.