[FIX] website: re-enable action buttons when canceling discard dialog
Steps to reproduce: - Go on website - Click on edit - Add a snippet - Click on discard - Close the popup using the 'X' at the top of the popup - Buttons are still disabled Commit [1] adapted the website dialogs to the OWL Api but also introduced this bug. This commit fixes that behaviour and re-enables the buttons if the popup is closed. [1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b task-2687506 Part-of: odoo/odoo#94564
This commit is contained in:
committed by
qsm-odoo
parent
24ca4ae3fb
commit
4292ed0e35
@@ -610,10 +610,19 @@ export class WysiwygAdapterComponent extends ComponentAdapter {
|
||||
*/
|
||||
_onCancelRequest(event) {
|
||||
if (this._isDirty()) {
|
||||
let discarding = false;
|
||||
this.dialogs.add(WebsiteDialog, {
|
||||
body: _t("If you discard the current edits, all unsaved changes will be lost. You can cancel to return to edit mode."),
|
||||
primaryClick: () => this.props.quitCallback(),
|
||||
secondaryClick: event.data.onReject,
|
||||
primaryClick: () => {
|
||||
discarding = true;
|
||||
},
|
||||
}, {
|
||||
onClose: () => {
|
||||
if (discarding) {
|
||||
return this.props.quitCallback();
|
||||
}
|
||||
return event.data.onReject();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return this.props.quitCallback();
|
||||
|
||||
Reference in New Issue
Block a user