summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2016-05-19 12:03:44 +0200
committerNicolas Lempereur <nle@odoo.com>2016-05-19 14:49:52 +0200
commit3b234a23cb3cf8b659f849c231fa3b2e160213b5 (patch)
tree8de946edc066337c244c522a42a559ca1b8e1a4a /addons/web/static/src/xml
parentdfcbcb02cea2b2f5c996933ea1d813e51da5f9d6 (diff)
[FIX] web: download file and editor firefox bug
When we download a file (as can be done with attachments in Odoo), firefox is opening the link in current window but cancel the action once it is aware the resource is to be downloaded. But this get firefox into a corrupt state for some contenteditable features, for example document.queryCommandState which is needed for the editor will after downloading a file throw an error consistently instead of working as expected. It can be reproduced on firefox (at least from version 32 to 46) with the following snippet: https://jsfiddle.net/s246u3ay/3/ The issue is probably linked to the following reported issue since 2005: https://bugzilla.mozilla.org/show_bug.cgi?id=297494 This commit avoid the bug by opening attachments download links in a new window instead of the current one. closes #12109 opw-676918
Diffstat (limited to 'addons/web/static/src/xml')
-rw-r--r--addons/web/static/src/xml/base.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 6049c64c9c0..ef57881d633 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -1064,7 +1064,7 @@
<t t-raw="file.name || file.filename"/>
</span>
<t t-if="(!file.upload or file.percent_loaded&gt;=100)">
- <a class="o_image" t-att-href="file.url" t-attf-title="#{(file.name || file.filename) + (file.date?' \n('+file.date+')':'' )}" t-att-data-mimetype="file.mimetype" t-attf-data-src="/web/image/#{file.id}/100x80">
+ <a class="o_image" target="_blank" t-att-href="file.url" t-attf-title="#{(file.name || file.filename) + (file.date?' \n('+file.date+')':'' )}" t-att-data-mimetype="file.mimetype" t-attf-data-src="/web/image/#{file.id}/100x80">
<t t-raw="file.name || file.filename"/>
</a>
<span class="fa fa-stack oe_delete" title="Delete this file" t-attf-data-id="#{file.id}">
@@ -1079,7 +1079,7 @@
<t t-foreach="widget.get('value')" t-as="id">
<t t-set="file" t-value="widget.data[id]"/>
<div>
- <a t-att-href="file.url" t-attf-title="#{(file.name || file.filename) + (file.date?' \n('+file.date+')':'' )}">
+ <a target="_blank" t-att-href="file.url" t-attf-title="#{(file.name || file.filename) + (file.date?' \n('+file.date+')':'' )}">
<t t-raw="file.name || file.filename"/>
</a>
</div>