Skip to content

Commit

Permalink
fix: Child block should not be link if parent is a link
Browse files Browse the repository at this point in the history
  • Loading branch information
surajshetty3416 committed Feb 19, 2025
1 parent 4c80aa8 commit 3251abd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
4 changes: 3 additions & 1 deletion frontend/src/components/BlockLayers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@
:blocks="element.children"
:ref="childLayer"
:indent="childIndent"
:disable-draggable="element.children.length && element.children[0].isChildOfComponentBlock()" />
:disable-draggable="
Boolean(element.children.length && element.children[0].isChildOfComponentBlock())
" />
</div>
</div>
</template>
Expand Down
17 changes: 3 additions & 14 deletions frontend/src/components/BlockPropertySections/LinkSection.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import InlineInput from "@/components/Controls/InlineInput.vue";
import { webPages } from "@/data/webPage";
import { BuilderPage } from "@/types/Builder/BuilderPage";
import blockController from "@/utils/blockController";
import { computed, nextTick } from "vue";

Expand All @@ -10,18 +8,7 @@ const linkSectionProperties = [
getProps: () => {
return {
label: "Link To",
type: "autocomplete",
showInputAsOption: true,
options: (webPages.data || [])
.filter((page: BuilderPage) => {
return page.route && !page.dynamic_route;
})
.map((page: BuilderPage) => {
return {
value: `/${page.route}`,
label: `/${page.route}`,
};
}),
modelValue: blockController.getAttribute("href"),
};
},
Expand Down Expand Up @@ -78,5 +65,7 @@ export default {
name: "Link",
properties: linkSectionProperties,
collapsed: computed(() => !blockController.isLink()),
condition: () => !blockController.multipleBlocksSelected(),
condition: () =>
!blockController.multipleBlocksSelected() &&
!blockController.getSelectedBlocks()[0].parentBlock?.isLink(),
};

0 comments on commit 3251abd

Please sign in to comment.