From 333b8aeed5b672ab7d45d7e996ec9b20261f2ab9 Mon Sep 17 00:00:00 2001 From: Gautam Bajaj Date: Thu, 9 May 2024 10:19:00 +0530 Subject: [PATCH] Review comments --- .../event-info-component.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/blocks/event-info-component/event-info-component.js b/blocks/event-info-component/event-info-component.js index 00b9df73..46355b1f 100644 --- a/blocks/event-info-component/event-info-component.js +++ b/blocks/event-info-component/event-info-component.js @@ -1,5 +1,5 @@ import { getLibs } from '../../scripts/utils.js'; -import { getIcon, handlize, generateToolTip, addRepeater } from '../../utils/utils.js'; +import { getIcon, handlize, generateToolTip } from '../../utils/utils.js'; const { createTag } = await import(`${getLibs()}/utils/utils.js`); @@ -34,12 +34,9 @@ async function decorateField(row, type = 'text') { if (maxCharNum) input.setAttribute('maxlength', maxCharNum); - const component = createTag('div'); - row.innerHTML = ''; - component.append(input, attrTextEl); - const wrapper = createTag('div', { class: 'info-field-wrapper' }); - wrapper.append(component); + row.innerHTML = ''; + wrapper.append(input, attrTextEl); row.append(wrapper); } @@ -106,12 +103,8 @@ export default function init(el) { const rows = el.querySelectorAll(':scope > div'); rows.forEach(async (r, i) => { - if (i === 1) { - await decorateField(r, 'text'); - } - if (i === 2) { - await decorateField(r, 'textarea'); - } + if (i === 1) await decorateField(r, 'text'); + if (i === 2) await decorateField(r, 'textarea'); if (i === 3) decorateDateTimeFields(r); }); }