do not hide search results when clicking, but hide on ESC

This commit is contained in:
Jörn Friedrich Dreyer 2015-01-02 14:46:35 +01:00
parent 2eec8dc156
commit 6c9d9d26bb
2 changed files with 14 additions and 14 deletions

View file

@ -7,11 +7,15 @@
overflow-x:hidden;
overflow-y: auto;
text-overflow:ellipsis;
padding-top: 45px;
padding-top: 65px;
height: 100%;
box-sizing: border-box;
z-index:75;
}
#searchresults.hidden {
display: none;
}
#searchresults * {
box-sizing: content-box;
}

View file

@ -276,12 +276,6 @@
currentResult++;
renderCurrent();
}
} else if(event.keyCode === 27) { //esc
$searchBox.val('');
if(self.hasFilter(getCurrentApp())) {
self.getFilter(getCurrentApp())('');
}
self.hideResults();
} else {
var query = $searchBox.val();
if (lastQuery !== query) {
@ -297,6 +291,15 @@
}
}
});
$(document).keyup(function(event) {
if(event.keyCode === 27) { //esc
$searchBox.val('');
if(self.hasFilter(getCurrentApp())) {
self.getFilter(getCurrentApp())('');
}
self.hideResults();
}
});
$searchResults.on('click', 'tr.result', function (event) {
var $row = $(this);
@ -316,13 +319,6 @@
scrollToResults();
return false;
});
$(document).click(function (event) {
$searchBox.val('');
if(self.hasFilter(getCurrentApp())) {
self.getFilter(getCurrentApp())('');
}
self.hideResults();
});
placeStatus();
OC.Plugins.attach('OCA.Search', this);