summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2016-06-24 17:12:02 +0200
committerGitHub <noreply@github.com>2016-06-24 17:12:02 +0200
commitc295523ae22c6de6c69b3e897de1ab03d81503ed (patch)
tree4831295aed662fcb1215ebe016e59ae3fb997ef1
parente9a0a6d83ad0ee4c9f3b3537cad63ee2457ac839 (diff)
parent39b533d0d89557a2349dd09b4602ab7a1a8cb9ec (diff)
downloadnextcloud-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.js11
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;