diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2015-01-05 14:28:09 +0100 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2015-01-05 14:28:09 +0100 |
commit | 10038640aeab6b156c15cac9fe8da438dad31d7b (patch) | |
tree | 0737dc52c83aefbc0d51157de2cc4e49e97a1449 | |
parent | ba931d2124a915233d99edabdac730f3a9abdd54 (diff) | |
download | nextcloud-server-10038640aeab6b156c15cac9fe8da438dad31d7b.tar.gz nextcloud-server-10038640aeab6b156c15cac9fe8da438dad31d7b.zip |
fix onScroll breaking search, fix keyboard navigation, fix filter for files in other dirs
-rw-r--r-- | apps/files/js/search.js | 7 | ||||
-rw-r--r-- | search/js/search.js | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/apps/files/js/search.js b/apps/files/js/search.js index 5fb10ef34cd..496c210232a 100644 --- a/apps/files/js/search.js +++ b/apps/files/js/search.js @@ -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: diff --git a/search/js/search.js b/search/js/search.js index d1e25913e37..58778900a69 100644 --- a/search/js/search.js +++ b/search/js/search.js @@ -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 ) { |