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>
This commit is contained in:
parent
4566670fa3
commit
bc74a44cbc
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue