summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2017-05-16 14:26:44 +0200
committerJulius Härtl <jus@bitgrid.net>2017-05-16 14:30:49 +0200
commitda281822b67594bb58e1b81a782d0090f32596e7 (patch)
treeb6bc39cb8c3969ebf3a3e6b53646c11c05bde08e
parentb1bd9ff0b95af68c9f5875de00806e37ef65a8b8 (diff)
downloadnextcloud-server-da281822b67594bb58e1b81a782d0090f32596e7.tar.gz
nextcloud-server-da281822b67594bb58e1b81a782d0090f32596e7.zip
Use proper mime icons for search results
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--apps/files/js/search.js30
1 files changed, 4 insertions, 26 deletions
diff --git a/apps/files/js/search.js b/apps/files/js/search.js
index 140a66e346d..aca6d42850e 100644
--- a/apps/files/js/search.js
+++ b/apps/files/js/search.js
@@ -67,7 +67,7 @@
$row.find('td.info div.name').after($pathDiv).text(result.name);
$row.find('td.result a').attr('href', result.link);
- $row.find('td.icon').css('background-image', 'url(' + OC.imagePath('core', 'filetypes/folder') + ')');
+ $row.find('td.icon').css('background-image', 'url(' + OC.MimeType.getIconUrl(result.mime) + ')');
return $row;
};
@@ -96,7 +96,7 @@
} else {
// FIXME how to get mime icon if not in files app
var mimeicon = result.mime.replace('/', '-');
- $row.find('td.icon').css('background-image', 'url(' + OC.imagePath('core', 'filetypes/' + mimeicon) + ')');
+ $row.find('td.icon').css('background-image', 'url(' + OC.MimeType.getIconUrl(result.mime) + ')');
var dir = OC.dirname(result.path);
if (dir === '') {
dir = '/';
@@ -108,28 +108,6 @@
return $row;
};
- this.renderAudioResult = function($row, result) {
- /*render preview icon, show path beneath filename,
- show size and last modified date on the right
- show Artist and Album */
- $row = this.renderFileResult($row, result);
- if ($row) {
- $row.find('td.icon').css('background-image', 'url(' + OC.imagePath('core', 'filetypes/audio') + ')');
- }
- return $row;
- };
-
- this.renderImageResult = function($row, result) {
- /*render preview icon, show path beneath filename,
- show size and last modified date on the right
- show width and height */
- $row = this.renderFileResult($row, result);
- if ($row && !self.fileAppLoaded()) {
- $row.find('td.icon').css('background-image', 'url(' + OC.imagePath('core', 'filetypes/image') + ')');
- }
- return $row;
- };
-
this.handleFolderClick = function($row, result, event) {
// open folder
@@ -179,8 +157,8 @@
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.setRenderer('image', this.renderFileResult.bind(this));
+ search.setRenderer('audio', this.renderFileResult.bind(this));
search.setHandler('folder', this.handleFolderClick.bind(this));
search.setHandler(['file', 'audio', 'image'], this.handleFileClick.bind(this));