Fix text files for search results

This commit is contained in:
Michael Gapczynski 2012-05-10 21:44:04 -04:00
parent 0c86f8a61e
commit a3f250bfe6
1 changed files with 4 additions and 3 deletions

View File

@ -303,13 +303,14 @@ $(document).ready(function(){
FileActions.setDefault('application/xml','Edit'); FileActions.setDefault('application/xml','Edit');
} }
OC.search.customResults.Text=function(row,item){ 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'); var a=row.find('a');
a.data('file',text); a.data('file',text);
a.attr('href','#'); a.attr('href','#');
a.click(function(){ a.click(function(){
var file=text.split('/').pop(); var pos=text.lastIndexOf('/')
var dir=text.substr(0,text.length-file.length-1); var file=text.substr(pos);
var dir=text.substr(0,pos);
showFileEditor(dir,file); showFileEditor(dir,file);
}); });
}; };