mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-22 12:06:57 -06:00
[IMP] simplify code
This commit is contained in:
parent
5b02ff9aa8
commit
e92e6e79c0
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user