[FIX] web_editor: correctly check the toggle of new window link
Before this commit and most likely since commit [1], the "Open in new window" option of link would not persist through editions. Steps to reproduce: - Create a link in the website builder - Set its "Open in new window" property to true - Save, and see that it works as expected - Now enter edit mode again, the toggle will be off and not on as it should be since the `target="_blank"` was correctly added. For easy of debugging and understanding, you can just grep this line ```js this.initialNewWindow = this.initialNewWindow || this.linkEl.target === '_blank'; ``` [1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997# opw-3781477 closes odoo/odoo#156739 X-original-commit: 5ea2e015a8faed502c378d4e5042f8a0cf50cbf9 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com> Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit is contained in:
@@ -83,7 +83,7 @@
|
||||
<div class="mb-3 row" t-if="!state.isButton and !props.forceNewWindow">
|
||||
<div class="offset-md-3 col-md-9">
|
||||
<label class="o_switch">
|
||||
<input type="checkbox" name="is_new_window" t-att-checked="this.initialIsNewWindow ? 'checked' : undefined"/>
|
||||
<input type="checkbox" name="is_new_window" t-att-checked="this.initialNewWindow ? 'checked' : undefined"/>
|
||||
<span/>
|
||||
Open in new window
|
||||
</label>
|
||||
@@ -289,10 +289,10 @@
|
||||
</we-select>
|
||||
</we-row>
|
||||
<we-row t-if="!state.isButton and !props.forceNewWindow">
|
||||
<we-button t-attf-class="o_we_user_value_widget o_we_checkbox_wrapper o_we_sublevel_1 #{this.initialIsNewWindow ? 'active' : ''}">
|
||||
<we-button t-attf-class="o_we_user_value_widget o_we_checkbox_wrapper o_we_sublevel_1 #{this.initialNewWindow ? 'active' : ''}">
|
||||
<we-title class="o_long_title">Open in new window</we-title>
|
||||
<div class="o_switch">
|
||||
<we-checkbox name="is_new_window" t-att-checked="this.initialIsNewWindow ? 'checked' : undefined"/>
|
||||
<we-checkbox name="is_new_window" t-att-checked="this.initialNewWindow ? 'checked' : undefined"/>
|
||||
</div>
|
||||
</we-button>
|
||||
</we-row>
|
||||
|
||||
Reference in New Issue
Block a user