diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-07-01 11:22:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-01 11:22:35 +0200 |
commit | abdc587b5c5e105ae7329cfc18e7eb4a22726163 (patch) | |
tree | 4084f112d918fefc9bb7958770ff6894e1735876 | |
parent | 98818283e5a30a1e6dc25e8ca7a031e9e531e36b (diff) | |
parent | fd05ff03928a24085c4d67e26780a368d137c6ff (diff) | |
download | nextcloud-server-abdc587b5c5e105ae7329cfc18e7eb4a22726163.tar.gz nextcloud-server-abdc587b5c5e105ae7329cfc18e7eb4a22726163.zip |
Merge pull request #25264 from owncloud/stable9-search-fixsearchfromotherfilelists
[stable9] 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; |