Skip to content

Commit f093055

Browse files
FrancoisGeged-odoo
authored andcommitted
Small fix legacy web_editor shape
1 parent f94d1c1 commit f093055

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

addons/html_builder/static/src/plugins/image/image_shape_option.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ export class ImageShapeOption extends BaseOptionComponent {
1010
this.customizeTabPlugin = this.env.editor.shared.customizeTab;
1111
this.imageShapeOption = this.env.editor.shared.imageShapeOption;
1212
this.toRatio = toRatio;
13-
this.state = useDomState((editingElement) => ({
14-
hasShape: !!editingElement.dataset.shape,
15-
shapeLabel: this.imageShapeOption.getShapeLabel(editingElement.dataset.shape),
16-
showImageShape0: this.isShapeVisible(editingElement, 0),
17-
showImageShape1: this.isShapeVisible(editingElement, 1),
18-
showImageShape2: this.isShapeVisible(editingElement, 2),
19-
showImageShape3: this.isShapeVisible(editingElement, 3),
20-
showImageShape4: this.isShapeVisible(editingElement, 4),
21-
showImageShapeTransform: this.imageShapeOption.isTransformableShape(
22-
editingElement.dataset.shape
23-
),
24-
showImageShapeAnimation: this.imageShapeOption.isAnimableShape(
25-
editingElement.dataset.shape
26-
),
27-
togglableRatio: this.imageShapeOption.isTogglableRatioShape(
28-
editingElement.dataset.shape
29-
),
30-
}));
13+
this.state = useDomState((editingElement) => {
14+
let shape = editingElement.dataset.shape;
15+
if (shape) {
16+
shape = shape.replace("web_editor", "html_builder");
17+
}
18+
return {
19+
hasShape: !!shape,
20+
shapeLabel: this.imageShapeOption.getShapeLabel(shape),
21+
showImageShape0: this.isShapeVisible(editingElement, 0),
22+
showImageShape1: this.isShapeVisible(editingElement, 1),
23+
showImageShape2: this.isShapeVisible(editingElement, 2),
24+
showImageShape3: this.isShapeVisible(editingElement, 3),
25+
showImageShape4: this.isShapeVisible(editingElement, 4),
26+
showImageShapeTransform: this.imageShapeOption.isTransformableShape(shape),
27+
showImageShapeAnimation: this.imageShapeOption.isAnimableShape(shape),
28+
togglableRatio: this.imageShapeOption.isTogglableRatioShape(shape),
29+
};
30+
});
3131
}
3232
isShapeVisible(img, shapeIndex) {
3333
const shapeName = img.dataset.shape;

0 commit comments

Comments
 (0)