Merge pull request #25264 from owncloud/stable9-search-fixsearchfromotherfilelists

[stable9] Fix search result link for file results outside default list
This commit is contained in:
Vincent Petry 2016-07-01 11:22:35 +02:00 committed by GitHub
commit abdc587b5c
1 changed files with 9 additions and 2 deletions

View File

@ -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;