[IMP] simplify code

This commit is contained in:
Holger Brunn 2015-11-18 08:44:46 +01:00
parent 5b02ff9aa8
commit e92e6e79c0
2 changed files with 3 additions and 8 deletions

View File

@ -28,10 +28,10 @@ openerp.attachment_preview = function(instance)
{
var url = (window.location.origin || '') +
'/attachment_preview/static/lib/ViewerJS/index.html' +
'&type=' + encodeURIComponent(attachment_extension) +
'#' +
attachment_url.replace(window.location.origin, '') +
'?type=' + encodeURIComponent(attachment_extension) +
'&title=' + encodeURIComponent(attachment_title) +
'#' +
attachment_url.replace(window.location.origin, '')
window.open(url);
};
openerp.attachment_preview.can_preview = function(extension)

View File

@ -28,10 +28,5 @@ Viewer = function(plugin, parameters)
{
alert('Unsupported file type');
}
var matches = (/&title=([^&]+)&/).exec(window.location.hash);
if(matches && matches.length > 1)
{
parameters.title = decodeURIComponent(matches[1]);
}
return original_Viewer(plugin, parameters);
}