mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-23 04:22:04 -06:00
[FIX] pass file extension where newer viewerjs versions expect it
fixes #67
This commit is contained in:
parent
e414291af6
commit
5b02ff9aa8
@ -27,10 +27,11 @@ openerp.attachment_preview = function(instance)
|
||||
attachment_title)
|
||||
{
|
||||
var url = (window.location.origin || '') +
|
||||
'/attachment_preview/static/lib/ViewerJS/index.html#' +
|
||||
'/attachment_preview/static/lib/ViewerJS/index.html' +
|
||||
'&type=' + encodeURIComponent(attachment_extension) +
|
||||
'#' +
|
||||
attachment_url.replace(window.location.origin, '') +
|
||||
'&title=' + encodeURIComponent(attachment_title) +
|
||||
'&ext=.' + encodeURIComponent(attachment_extension);
|
||||
window.open(url);
|
||||
};
|
||||
openerp.attachment_preview.can_preview = function(extension)
|
||||
|
@ -24,6 +24,10 @@
|
||||
var original_Viewer = Viewer;
|
||||
Viewer = function(plugin, parameters)
|
||||
{
|
||||
if(!plugin)
|
||||
{
|
||||
alert('Unsupported file type');
|
||||
}
|
||||
var matches = (/&title=([^&]+)&/).exec(window.location.hash);
|
||||
if(matches && matches.length > 1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user