diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-12-31 16:36:00 +0100 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2015-01-02 10:28:42 +0100 |
commit | f8700ec6492ef9be32e75fc56adb4fb836b9bd9b (patch) | |
tree | 042ede17d91db0b61aa55849d00a2110764a041e /apps/files/js/search.js | |
parent | 457f5abf6cc611064b30bdc0d70a8d42a73c9706 (diff) | |
download | nextcloud-server-f8700ec6492ef9be32e75fc56adb4fb836b9bd9b.tar.gz nextcloud-server-f8700ec6492ef9be32e75fc56adb4fb836b9bd9b.zip |
Fix rendering search results
Diffstat (limited to 'apps/files/js/search.js')
-rw-r--r-- | apps/files/js/search.js | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/apps/files/js/search.js b/apps/files/js/search.js index 6f034f79f60..050f5f259ba 100644 --- a/apps/files/js/search.js +++ b/apps/files/js/search.js @@ -136,6 +136,13 @@ } }; + this.updateLegacyMimetype = function (result) { + // backward compatibility: + if (!result.mime && result.mime_type) { + result.mime = result.mime_type; + } + }; + OC.Plugins.register('OCA.Search', this); }, attach: function(search) { @@ -146,13 +153,13 @@ } }); - search.setRenderer('folder', this.renderFolderResult); - search.setRenderer('file', this.renderFileResult); - search.setRenderer('audio', this.renderAudioResult); - search.setRenderer('image', this.renderImageResult); + search.setRenderer('folder', this.renderFolderResult.bind(this)); + search.setRenderer('file', this.renderFileResult.bind(this)); + search.setRenderer('audio', this.renderAudioResult.bind(this)); + search.setRenderer('image', this.renderImageResult.bind(this)); - search.setHandler('folder', this.handleFolderClick); - search.setHandler(['file', 'audio', 'image'], this.handleFileClick); + search.setHandler('folder', this.handleFolderClick.bind(this)); + search.setHandler(['file', 'audio', 'image'], this.handleFileClick.bind(this)); } }; new Files(); |