Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gbajaj91 committed May 9, 2024
1 parent 3c1d0a5 commit 333b8ae
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions blocks/event-info-component/event-info-component.js
Original file line number Diff line number Diff line change
@@ -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`);

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
});
}

0 comments on commit 333b8ae

Please sign in to comment.