Merge pull request #4950 from owncloud/fix_preview_shared_folder
Fix preview for shared folder and public upload
This commit is contained in:
commit
46f64cc39a
2 changed files with 7 additions and 3 deletions
|
@ -644,7 +644,11 @@ function lazyLoadPreview(path, mime, ready, width, height) {
|
|||
if ( ! height ) {
|
||||
height = $('#filestable').data('preview-y');
|
||||
}
|
||||
if( $('#publicUploadButtonMock').length ) {
|
||||
var previewURL = OC.Router.generate('core_ajax_public_preview', {file: encodeURIComponent(path), x:width, y:height, t:$('#dirToken').val()});
|
||||
} else {
|
||||
var previewURL = OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:width, y:height});
|
||||
}
|
||||
$.get(previewURL, function() {
|
||||
previewURL = previewURL.replace('(', '%28');
|
||||
previewURL = previewURL.replace(')', '%29');
|
||||
|
|
|
@ -39,8 +39,8 @@ class Helper
|
|||
}
|
||||
|
||||
if($file['isPreviewAvailable']) {
|
||||
$relativePath = substr($file['path'], 6);
|
||||
return \OC_Helper::previewIcon($relativePath);
|
||||
$pathForPreview = $file['directory'] . '/' . $file['name'];
|
||||
return \OC_Helper::previewIcon($pathForPreview);
|
||||
}
|
||||
return \OC_Helper::mimetypeIcon($file['mimetype']);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue