Skip to content

Commit 75a965e

Browse files
bso-odooFrancoisGe
authored andcommitted
close customize component on selection, undo and redo, and default 1st
1 parent d2a1984 commit 75a965e

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

addons/html_builder/static/src/core/customize_tab_plugin.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import { registry } from "@web/core/registry";
55
export class CustomizeTabPlugin extends Plugin {
66
static id = "customizeTab";
77
static shared = ["getCustomizeComponent", "openCustomizeComponent", "closeCustomizeComponent"];
8+
resources = {
9+
post_redo_handlers: () => this.closeCustomizeComponent(),
10+
post_undo_handlers: () => this.closeCustomizeComponent(),
11+
change_current_options_containers_listeners: () => this.closeCustomizeComponent(),
12+
};
813

914
setup() {
1015
this.customizeComponent = reactive({
@@ -26,9 +31,11 @@ export class CustomizeTabPlugin extends Plugin {
2631
};
2732
}
2833
closeCustomizeComponent() {
29-
this.customizeComponent.component = null;
30-
this.customizeComponent.editingEls = null;
31-
this.customizeComponent.props = {};
34+
if (this.customizeComponent) {
35+
this.customizeComponent.component = null;
36+
this.customizeComponent.editingEls = null;
37+
this.customizeComponent.props = {};
38+
}
3239
}
3340
}
3441

addons/html_builder/static/src/plugins/background_option/background_shape_option_plugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ export class BackgroundShapeOptionPlugin extends Plugin {
8181
// If there is no previous sibling, if the previous sibling
8282
// had the last shape selected or if the previous shape
8383
// could not be found in the possible shapes, default to the
84-
// first shape. ([0] being no shapes selected.)
84+
// first shape.
8585
if (!shapeToSelect) {
86-
shapeToSelect = allPossiblesShapesUrl[1];
86+
shapeToSelect = allPossiblesShapesUrl[0];
8787
}
8888
// Only show on mobile by default if toggled from mobile
8989
// view.

0 commit comments

Comments
 (0)