summaryrefslogtreecommitdiffstats
path: root/apps/files_texteditor/js/editor.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_texteditor/js/editor.js')
-rw-r--r--apps/files_texteditor/js/editor.js7
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);
});
};