]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixed path in other folders search 3557/head
authorMarcin <M.Czarnecki1@uni.brighton.ac.uk>
Tue, 21 Feb 2017 00:38:46 +0000 (00:38 +0000)
committerGitHub <noreply@github.com>
Tue, 21 Feb 2017 00:38:46 +0000 (00:38 +0000)
Signed-off-by: Marcin Czarnecki <marcin.czarnecki@protonmail.com>
apps/files/js/search.js

index fa79d695165f8217c248c4360b536c53b68dd1f4..140a66e346da2e4552db158ff970b5f3da805ba4 100644 (file)
@@ -63,7 +63,7 @@
                                 show size and last modified date on the right */
                                this.updateLegacyMimetype(result);
 
-                               var $pathDiv = $('<div class="path"></div>').text(result.path.substr(1));
+                               var $pathDiv = $('<div class="path"></div>').text(result.path.substr(1, result.path.lastIndexOf("/")));
                                $row.find('td.info div.name').after($pathDiv).text(result.name);
 
                                $row.find('td.result a').attr('href', result.link);
@@ -80,7 +80,7 @@
                                 show size and last modified date on the right */
                                this.updateLegacyMimetype(result);
 
-                               var $pathDiv = $('<div class="path"></div>').text(result.path.substr(1));
+                               var $pathDiv = $('<div class="path"></div>').text(result.path.substr(1, result.path.lastIndexOf("/")));
                                $row.find('td.info div.name').after($pathDiv).text(result.name);
 
                                $row.find('td.result a').attr('href', result.link);