Fix image previews for search results

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

View File

@ -6,12 +6,13 @@ $(document).ready(function() {
FileActions.setDefault('image','View');
}
OC.search.customResults.Images=function(row,item){
var image=item.link.substr(item.link.indexOf('file=')+5);
var image=item.link.substr(item.link.indexOf('?file=')+6);
var a=row.find('a');
a.attr('href','#');
a.click(function(){
var file=image.split('/').pop();
var dir=image.substr(0,image.length-file.length-1);
var pos=image.lastIndexOf('/')
var file=image.substr(pos);
var dir=image.substr(0,pos);
viewImage(dir,file);
});
}