summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-06-26 12:55:05 +0200
committerLukas Reschke <lukas@owncloud.com>2016-06-26 12:55:05 +0200
commit7a9d60d87eb8e4414e5fe05830b088d426ff810d (patch)
tree0fc97a7eacfd071475afd8bc6d4372babacb5740 /apps/files/js
parent5387b942c44e05b87ba2a0fd54168f5278a31344 (diff)
parent52eab2a61a5d27b64fcd0440b91f854c052933a9 (diff)
downloadnextcloud-server-7a9d60d87eb8e4414e5fe05830b088d426ff810d.tar.gz
nextcloud-server-7a9d60d87eb8e4414e5fe05830b088d426ff810d.zip
Merge remote-tracking branch 'upstream/master' into master-upstream-sync
Diffstat (limited to 'apps/files/js')
-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;