first set of fix in js

This commit is contained in:
Jerome Sonnet (be-cloud.be) 2017-03-01 08:44:08 +00:00
parent 970384ad09
commit c133a46acb
2 changed files with 2 additions and 4 deletions

View File

@ -40,9 +40,7 @@ odoo.define('attachment_preview.attachment_preview', function(require) {
{ {
var url = (window.location.origin || '') + var url = (window.location.origin || '') +
'/attachment_preview/static/lib/ViewerJS/index.html#' + '/attachment_preview/static/lib/ViewerJS/index.html#' +
attachment_url.replace(window.location.origin, '') + attachment_url.replace(window.location.origin, '');
'&title=' + encodeURIComponent(attachment_title) +
'&ext=.' + encodeURIComponent(attachment_extension);
window.open(url); window.open(url);
}; };

View File

@ -3,7 +3,7 @@
<t t-extend="Sidebar"> <t t-extend="Sidebar">
<t t-jquery="span.oe_sidebar_delete_item" t-operation="before"> <t t-jquery="span.oe_sidebar_delete_item" t-operation="before">
<span t-if="section.name == 'files' and !item.callback and item.url" href="#" class="oe-sidebar-attachment-preview" t-att-data-id="item.id" t-att-data-url="item.url" t-attf-title="Preview #{item.name}"> <span t-if="section.name == 'files' and !item.callback and item.url" href="#" class="oe-sidebar-attachment-preview" t-att-data-id="item.id" t-att-data-url="item.url" t-attf-title="Preview #{item.name}">
<img t-att-src='_s + "/web/static/src/img/icons/gtk-print-preview.png"' width="12" height="12" border="0"/> <img t-att-src='_s + "/web/static/src/img/icons/gtk-print-preview.png"' width="12" height="12" border="0" style="padding:10px;"/>
</span> </span>
</t> </t>
</t> </t>