Skip to content

Commit

Permalink
carousel type logic added for the nested tab
Browse files Browse the repository at this point in the history
  • Loading branch information
omprakashgupta1995 committed Jul 4, 2024
1 parent f848bf7 commit e478769
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions blocks/tab-name-nested/tab-name-nested.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { createButton, createCarousle, getProps } from "../../scripts/scripts.js
import { generateTabName } from "../tab-name/tab-name.js";

export default function decorate(block) {
const [parentTabName, parentTabId, child1TabName, child1TabId, child2TabName, child2TabId] = getProps(block);
const [parentTabName, parentTabId, child1TabName, child1TabId, child2TabName, child2TabId, prev, next, child1Type, child2Type] = getProps(block, {
picture: true
});
// const names = parentTabName.split(",");
const ids = parentTabId.split(",");
// const child1names = child1TabName.split(",");
Expand All @@ -11,8 +13,8 @@ export default function decorate(block) {
// const child2ids = child2TabId.split(",");
const copyblock = copyElements(block);
block.innerHTML = "";
const child1 = generateTabName(createBlockElement([copyblock.children[2], copyblock.children[3], "", "carousel", "<", ">"]))
const child2 = generateTabName(createBlockElement([copyblock.children[4], copyblock.children[5], "", "carousel", "<", ">"]))
const child1 = generateTabName(createBlockElement([copyblock.children[2], copyblock.children[3], "", child1Type, prev, next]))
const child2 = generateTabName(createBlockElement([copyblock.children[4], copyblock.children[5], "", child2Type, prev, next]))
child1.dataset.id = ids[0];
child2.dataset.id = ids[1];
child1.classList.add("nested-tab-name-child")
Expand Down

0 comments on commit e478769

Please sign in to comment.