summaryrefslogtreecommitdiffstats
path: root/apps/comments/js/search.js
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-12-21 20:15:15 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-01-03 11:39:16 +0100
commit5f3d6b5fbc19f7504cef57f25357c1aef6d869d4 (patch)
treec8df577470fd4fad54f11a221c9965d10fdf7dce /apps/comments/js/search.js
parent43ddf715d016ddf0f72d21e0f97bc6cd991f6de8 (diff)
downloadnextcloud-server-5f3d6b5fbc19f7504cef57f25357c1aef6d869d4.tar.gz
nextcloud-server-5f3d6b5fbc19f7504cef57f25357c1aef6d869d4.zip
Fix opening search results for comments
"OC.dirname" removes everything after the last "/", so a path without slashes is returned without changes. "result.path" does not include leading nor trailing "/", so when the path is for a file or folder in the base folder "OC.dirname(result.path)" returns "result.path". Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/comments/js/search.js')
-rw-r--r--apps/comments/js/search.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/comments/js/search.js b/apps/comments/js/search.js
index 11a96594580..8e0a35ff6ed 100644
--- a/apps/comments/js/search.js
+++ b/apps/comments/js/search.js
@@ -92,7 +92,9 @@
.css('background-image', 'url(' + OC.imagePath('core', 'actions/comment') + ')')
.css('opacity', '.4');
var dir = OC.dirname(result.path);
- if (dir === '') {
+ // "result.path" does not include a leading "/", so "OC.dirname"
+ // returns the path itself for files or folders in the root.
+ if (dir === result.path) {
dir = '/';
}
$row.find('td.info a').attr('href',