Skip to content
Snippets Groups Projects
Commit 10038640 authored by Jörn Friedrich Dreyer's avatar Jörn Friedrich Dreyer
Browse files

fix onScroll breaking search, fix keyboard navigation, fix filter for files in other dirs

parent ba931d21
Branches
No related tags found
No related merge requests found
......@@ -34,7 +34,12 @@
return !!OCA.Files && !!OCA.Files.App;
};
function inFileList($row, result) {
return self.fileAppLoaded() && self.fileList.inList(result.name);
if (! self.fileAppLoaded()) {
return false;
}
var dir = self.fileList.getCurrentDirectory().replace(/\/+$/,'');
var resultDir = OC.dirname(result.path);
return dir === resultDir && self.fileList.inList(result.name);
}
function updateLegacyMimetype(result) {
// backward compatibility:
......
......@@ -213,7 +213,7 @@
var result = $searchResults.find('tr.result')[currentResult];
if (result) {
var $result = $(result);
var currentOffset = $searchResults.scrollTop();
var currentOffset = $('#app-content').scrollTop();
$('#app-content').animate({
// Scrolling to the top of the new result
scrollTop: currentOffset + $result.offset().top - $result.height() * 2
......@@ -235,7 +235,7 @@
* This appends/renders the next page of entries when reaching the bottom.
*/
function onScroll(e) {
if ($searchResults) {
if ($searchResults && lastQuery !== false) {
var resultsBottom = $searchResults.offset().top + $searchResults.height();
var containerBottom = $searchResults.offsetParent().offset().top + $searchResults.offsetParent().height();
if ( resultsBottom < containerBottom * 1.2 ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment