From e2465c67930894b37fe0d1735a17e3d474eb0bf7 Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Fri, 21 Dec 2018 20:15:15 +0100 Subject: Fix opening search results for comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "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 --- apps/comments/js/search.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apps') 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', -- cgit v1.2.3