Skip to content

Commit

Permalink
d-none
Browse files Browse the repository at this point in the history
  • Loading branch information
Goaman committed Jan 15, 2025
1 parent c609e27 commit 809c4f0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<t t-name="html_builder.BuilderRow">
<BuilderComponent dependencies="props.dependencies">
<div class="d-flex p-1 px-2 hb-row" t-att-class="props.extraClassName or ''" t-ref="root">
<div class="d-flex p-1 px-2 hb-row" t-att-class="this.props.extraClassName || ''" t-ref="root">
<div class="d-flex" style="flex-grow: 0.4; flex-basis: 0; min-width: 0;" t-att-data-tooltip="props.tooltip">
<span class="text-nowrap text-truncate" t-out="props.label"/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function useDomState(getState) {
}

export class BuilderComponent extends Component {
static template = xml`<t t-if="this.state.isVisible"><t t-slot="default"/></t>`;
static template = xml`<div t-att-class="this.state.isVisible ? 'd-contents' : 'd-none'"><t t-slot="default"/></div>`;
static props = {
dependencies: { type: [String, { type: Array, element: String }], optional: true },
slots: { type: Object },
Expand Down Expand Up @@ -315,7 +315,7 @@ export function useClickableBuilderComponent() {
function callApply(applySpecs) {
comp.env.selectableContext?.cleanSelectedItem(applySpecs);
const cleans = inheritedActionIds
?.map((actionId) => comp.env.dependencyManager.get(actionId)?.cleanSelectedItem)
?.map((actionId) => comp.env.dependencyManager.get(actionId).cleanSelectedItem)
.filter(Boolean);
for (const clean of new Set(cleans)) {
clean(applySpecs);
Expand Down Expand Up @@ -506,7 +506,7 @@ export function useInputBuilderComponent() {
export function useApplyVisibility(refName) {
const ref = useRef(refName);
return (hasContent) => {
ref.el?.classList.toggle("d-none", !hasContent);
ref.el?.classList.toggle("builder-hidden", !hasContent);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,9 @@
.o-snippets-tabs > button[disabled] {
opacity: .5;
}
.builder-hidden {
display: none !important;
}
.d-contents {
display: contents;
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
data-step="1" data-min="1" data-unit="px" data-dependencies="hover_effect_outline_opt" data-no-preview="true"/>
</div> -->
</BuilderRow>
<BuilderRow label.translate="Direction" t-if="state.hasAnimateClass and !state.isLimitedAnimation">
<BuilderRow label.translate="Direction" extraClassName="(state.hasAnimateClass and !state.isLimitedAnimation) ? '' : 'd-none'">
<BuilderSelect id="'animation_direction_opt'" action="'forceAnimation'">
<BuilderSelectItem classAction="''"
id="'animation_direction_in_place_opt'"
Expand Down

0 comments on commit 809c4f0

Please sign in to comment.