Skip to content

Commit

Permalink
[FIX] web_editor, mass_mailing: create link in new tab
Browse files Browse the repository at this point in the history
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#82709

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
  • Loading branch information
Goaman committed Jan 13, 2022
1 parent 0b2b9cc commit c6b7556
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions addons/mass_mailing/static/src/js/mass_mailing_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion addons/web_editor/static/src/js/wysiwyg/wysiwyg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit c6b7556

Please sign in to comment.