diff options
author | Michael Gapczynski <GapczynskiM@gmail.com> | 2012-05-10 21:44:04 -0400 |
---|---|---|
committer | Michael Gapczynski <GapczynskiM@gmail.com> | 2012-05-10 21:44:04 -0400 |
commit | a3f250bfe6f5a9fa71073ca353f504176a342213 (patch) | |
tree | a8991a676239e29ea2f67968024fac5089544d78 /apps | |
parent | 0c86f8a61e3e02a07ccfebce5b15dfefde8230d4 (diff) | |
download | nextcloud-server-a3f250bfe6f5a9fa71073ca353f504176a342213.tar.gz nextcloud-server-a3f250bfe6f5a9fa71073ca353f504176a342213.zip |
Fix text files for search results
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_texteditor/js/editor.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/files_texteditor/js/editor.js b/apps/files_texteditor/js/editor.js index b891ef29b96..36ab196b642 100644 --- a/apps/files_texteditor/js/editor.js +++ b/apps/files_texteditor/js/editor.js @@ -303,13 +303,14 @@ $(document).ready(function(){ FileActions.setDefault('application/xml','Edit'); } OC.search.customResults.Text=function(row,item){ - var text=item.link.substr(item.link.indexOf('file=')+5); + var text=item.link.substr(item.link.indexOf('?file=')+6); var a=row.find('a'); a.data('file',text); a.attr('href','#'); a.click(function(){ - var file=text.split('/').pop(); - var dir=text.substr(0,text.length-file.length-1); + var pos=text.lastIndexOf('/') + var file=text.substr(pos); + var dir=text.substr(0,pos); showFileEditor(dir,file); }); }; |