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
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,12 @@ ...@@ -34,7 +34,12 @@
return !!OCA.Files && !!OCA.Files.App; return !!OCA.Files && !!OCA.Files.App;
}; };
function inFileList($row, result) { 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) { function updateLegacyMimetype(result) {
// backward compatibility: // backward compatibility:
......
...@@ -213,7 +213,7 @@ ...@@ -213,7 +213,7 @@
var result = $searchResults.find('tr.result')[currentResult]; var result = $searchResults.find('tr.result')[currentResult];
if (result) { if (result) {
var $result = $(result); var $result = $(result);
var currentOffset = $searchResults.scrollTop(); var currentOffset = $('#app-content').scrollTop();
$('#app-content').animate({ $('#app-content').animate({
// Scrolling to the top of the new result // Scrolling to the top of the new result
scrollTop: currentOffset + $result.offset().top - $result.height() * 2 scrollTop: currentOffset + $result.offset().top - $result.height() * 2
...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
* This appends/renders the next page of entries when reaching the bottom. * This appends/renders the next page of entries when reaching the bottom.
*/ */
function onScroll(e) { function onScroll(e) {
if ($searchResults) { if ($searchResults && lastQuery !== false) {
var resultsBottom = $searchResults.offset().top + $searchResults.height(); var resultsBottom = $searchResults.offset().top + $searchResults.height();
var containerBottom = $searchResults.offsetParent().offset().top + $searchResults.offsetParent().height(); var containerBottom = $searchResults.offsetParent().offset().top + $searchResults.offsetParent().height();
if ( resultsBottom < containerBottom * 1.2 ) { if ( resultsBottom < containerBottom * 1.2 ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment