diff options
-rw-r--r-- | apps/files/js/search.js | 11 | ||||
-rw-r--r-- | core/js/files/iedavclient.js | 1 |
2 files changed, 10 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; diff --git a/core/js/files/iedavclient.js b/core/js/files/iedavclient.js index 9e83f5b9a22..a0185fb3bec 100644 --- a/core/js/files/iedavclient.js +++ b/core/js/files/iedavclient.js @@ -29,6 +29,7 @@ var self = this; var xhr = this.xhrProvider(); + headers = headers || {}; if (this.userName) { headers['Authorization'] = 'Basic ' + btoa(this.userName + ':' + this.password); |