Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export class AddElementOption extends Component {
static components = {
...defaultOptionComponents,
};
static props = {};

addText() {
console.log("addText");
}
Expand Down
16 changes: 7 additions & 9 deletions addons/html_builder/static/src/builder/options/layout_option.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import { defaultOptionComponents } from "../components/defaultComponents";
import { useDomState } from "../builder_helpers";
import { SpacingOption } from "./spacing_option";
import { AddElementOption } from "./add_element_option";

// TODO to import in html_builder
import {
_convertToNormalColumn,
_reloadLazyImages,
_toggleGridMode,
} from "@web_editor/js/common/grid_layout_utils";
convertToNormalColumn,
reloadLazyImages,
toggleGridMode,
} from "@html_builder/builder/utils/grid_layout_utils";

export class LayoutOption extends Component {
static template = "html_builder.LayoutOption";
Expand All @@ -35,7 +33,7 @@ export class LayoutOption extends Component {
// Prevent toggling grid mode twice.
return;
}
_toggleGridMode(this.env.getEditingElement().querySelector(".container"));
toggleGridMode(this.env.getEditingElement().querySelector(".container"));
this.env.editor.shared.history.addStep();
}
setColumnLayout() {
Expand All @@ -52,9 +50,9 @@ export class LayoutOption extends Component {

for (const columnEl of columnEls) {
// Reloading the images.
_reloadLazyImages(columnEl);
reloadLazyImages(columnEl);
// Removing the grid properties.
_convertToNormalColumn(columnEl);
convertToNormalColumn(columnEl);
}
// Removing the grid properties.
delete rowEl.dataset.rowCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export class SpacingOption extends Component {
static components = {
...defaultOptionComponents,
};
static props = {};

setup() {
this.target = this.env.getEditingElement().querySelector(".o_grid_mode");
this.targetComputedStyle = getComputedStyle(this.target);
Expand Down
Loading