diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2016-06-24 17:12:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-24 17:12:02 +0200 |
commit | c295523ae22c6de6c69b3e897de1ab03d81503ed (patch) | |
tree | 4831295aed662fcb1215ebe016e59ae3fb997ef1 | |
parent | e9a0a6d83ad0ee4c9f3b3537cad63ee2457ac839 (diff) | |
parent | 39b533d0d89557a2349dd09b4602ab7a1a8cb9ec (diff) | |
download | nextcloud-server-c295523ae22c6de6c69b3e897de1ab03d81503ed.tar.gz nextcloud-server-c295523ae22c6de6c69b3e897de1ab03d81503ed.zip |
Merge pull request #25259 from owncloud/search-fixsearchfromotherfilelists
Fix search result link for file results outside default list
-rw-r--r-- | apps/files/js/search.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/files/js/search.js b/apps/files/js/search.js index 394bcb48603..625e4b13f4b 100644 --- a/apps/files/js/search.js +++ b/apps/files/js/search.js @@ -133,7 +133,7 @@ this.handleFolderClick = function($row, result, event) { // open folder - if (self.fileAppLoaded()) { + if (self.fileAppLoaded() && self.fileList.id === 'files') { self.fileList.changeDirectory(result.path); return false; } else { @@ -142,7 +142,7 @@ }; this.handleFileClick = function($row, result, event) { - if (self.fileAppLoaded()) { + if (self.fileAppLoaded() && self.fileList.id === 'files') { self.fileList.changeDirectory(OC.dirname(result.path)); self.fileList.scrollTo(result.name); return false; @@ -184,6 +184,13 @@ search.setHandler('folder', this.handleFolderClick.bind(this)); search.setHandler(['file', 'audio', 'image'], this.handleFileClick.bind(this)); + + if (self.fileAppLoaded()) { + // hide results when switching directory outside of search results + $('#app-content').delegate('>div', 'changeDirectory', function() { + search.clear(); + }); + } } }; OCA.Search.Files = Files; |