From e4787694b7f2092a1beb7f0257673dc2432c5e59 Mon Sep 17 00:00:00 2001 From: Om Gupta Date: Thu, 4 Jul 2024 11:38:50 +0530 Subject: [PATCH] carousel type logic added for the nested tab --- blocks/tab-name-nested/tab-name-nested.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/blocks/tab-name-nested/tab-name-nested.js b/blocks/tab-name-nested/tab-name-nested.js index a6f0d3a2eb..75b22a522d 100644 --- a/blocks/tab-name-nested/tab-name-nested.js +++ b/blocks/tab-name-nested/tab-name-nested.js @@ -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(","); @@ -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")