[IMP] web: open external links (from PDF viewer) in new tab

Currently when we click on external links from a PDF opened in our
PDF viewer, you are redirected to the link, means you are leaving
the record which is not ideal.

With this commit, external links in PDF document will be opened in
new tab so that the opened record is not lost. For that we need to
change the default option of the pdfjs lib, because we cannot pass
this parameter in iframe (link of the documentation is available in
task pad). For that, we changed the value of 'externalLinkTarget'
from 0 (which sets target to NONE) to 2 (which sets target to BLANK)
in 'getDefaultPreferences' function.

taskID-2752002

closes odoo/odoo#84594

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
dht-odoo
2022-03-14 17:28:08 +00:00
committed by Dharmraj Jhala
parent 8b8eaba450
commit 74fa91e0b3
+2 -2
View File
@@ -13913,9 +13913,9 @@ function getDefaultPreferences() {
"disablePageLabels": false,
"enablePrintAutoRotate": false,
"enableWebGL": false,
// Odoo: This change is needed here as we can't change this parameter in an iframe.
// Odoo: Below two preference changes are needed here as we can't change them as parameters in an iframe.
"eventBusDispatchToDOM": true,
"externalLinkTarget": 0,
"externalLinkTarget": 2,
"historyUpdateUrl": false,
"pdfBugEnabled": false,
"renderer": "canvas",