[FIX] web_editor, mass_mailing: create link in new tab
In mass_mailing, creating a link from the linktool in mass mailing generated link that would not create a new tab when clicked. Task-2734760 closes odoo/odoo#82735 X-original-commit: c6b7556a35182174c3384c2069256826205bba22 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
@@ -307,6 +307,7 @@ var MassMailingFieldHtml = FieldHtml.extend({
|
||||
_getWysiwygOptions: function () {
|
||||
const options = this._super.apply(this, arguments);
|
||||
options.resizable = false;
|
||||
options.defaultDataForLinkTools = { isNewWindow: true };
|
||||
if (!this._wysiwygSnippetsActive) {
|
||||
delete options.snippets;
|
||||
}
|
||||
|
||||
@@ -905,7 +905,8 @@ const Wysiwyg = Widget.extend({
|
||||
if (options.forceOpen || !this.linkTools) {
|
||||
const $btn = this.toolbar.$el.find('#create-link');
|
||||
if (!this.linkTools || ![options.link, ...wysiwygUtils.ancestors(options.link)].includes(this.linkTools.$link[0])) {
|
||||
this.linkTools = new weWidgets.LinkTools(this, {wysiwyg: this, noFocusUrl: options.noFocusUrl}, this.odooEditor.editable, {}, $btn, options.link || this.lastMediaClicked);
|
||||
const linkToolsData = Object.assign({}, this.options.defaultDataForLinkTools);
|
||||
this.linkTools = new weWidgets.LinkTools(this, {wysiwyg: this, noFocusUrl: options.noFocusUrl}, this.odooEditor.editable, linkToolsData, $btn, options.link || this.lastMediaClicked);
|
||||
}
|
||||
this.linkTools.noFocusUrl = options.noFocusUrl;
|
||||
const _onMousedown = ev => {
|
||||
|
||||
Reference in New Issue
Block a user