From 7d21ccbb65368e4fb3cfcbd09c6edb4e2147028d Mon Sep 17 00:00:00 2001 From: Gowtami Date: Mon, 23 Oct 2023 18:49:50 +0530 Subject: [PATCH] fixed lint issues --- blocks/columns/columns.js | 40 ----------------------------------- blocks/contactus/contactus.js | 10 ++++----- 2 files changed, 5 insertions(+), 45 deletions(-) diff --git a/blocks/columns/columns.js b/blocks/columns/columns.js index 228d1631..9b78c812 100644 --- a/blocks/columns/columns.js +++ b/blocks/columns/columns.js @@ -5,10 +5,6 @@ export default function decorate(block) { // setup image columns [...block.children].forEach((row) => { [...row.children].forEach((col) => { - /*row.children[0].setAttribute('class', 'col recent-posts'); - row.children[1].setAttribute('class', 'col recent-posts'); - let colPTags = col.querySelector('p');*/ - const pic = col.querySelector('picture'); if (pic) { const picWrapper = pic.closest('div'); @@ -19,40 +15,4 @@ export default function decorate(block) { } }); }); - - const section = document.getElementsByClassName('section columns-container'); - const html = section[0].innerHTML; - section[0].setAttribute('class','section columns-container outer'); - const column = document.getElementsByClassName('columns-wrapper'); - for(let i = 0; i < column.length; i++) { - if(column[i].children[0].classList.contains('columns-2-cols') && !column[i].children[0].classList.contains('posts')){ - column[i].children[0].setAttribute('class','columns block columns-2-cols posts'); - const post = column[i].children[0].children; - console.log(post); - for(let j = 0; j < post.length; j++) { - post[j].setAttribute('class','post'); - //console.log(post[j].children); - const divtag = post[j].children; - for(let l = 0; l < divtag.length; l++){ - const postFirstChild = divtag[l].getElementsByTagName('p'); - - for(let k = 0; k < postFirstChild.length; k++) { - if(k==0){ - postFirstChild[1].children[1].outerHTML='

'+postFirstChild[1].children[1].outerHTML+'

'; - //console.log(postFirstChild[1].children[1]); - postFirstChild[1].outerHTML= '
'+postFirstChild[1].innerHTML +'

'+postFirstChild[2].innerHTML+'

'+'
' - postFirstChild[2].innerHTML=''; - postFirstChild[0].outerHTML='

'+postFirstChild[0].innerHTML+'

'; - } - } - } - -} - - - column[i].setAttribute('class','col recent-posts'); - //console.log('col>'+col); - } - } - } diff --git a/blocks/contactus/contactus.js b/blocks/contactus/contactus.js index 0a6fd8f9..f788b7df 100644 --- a/blocks/contactus/contactus.js +++ b/blocks/contactus/contactus.js @@ -11,12 +11,12 @@ export default function decorate() { if (i === 0) { const ContactUsTitle = pTags[i].outerHTML.replace(/

/g, '

'); innerElements += ContactUsTitle.replace(/<\/p>/g, '

'); - } else if (i === 1) { - innerElements +=pTags[i].outerHTML; - } else if (i === 3) { - phone = pTags[2].outerHTML.replace(/

/g, ''); + } else if (i === 1) { + innerElements += pTags[i].outerHTML; + } else if (i === 3) { + phone = pTags[2].outerHTML.replace(/

/g, ''); phone.replace(/<\/p>/g, ''); - pTags[i].innerHTML = '

' + phone + pTags[i].innerHTML +'
'; + pTags[i].innerHTML = '
' + phone + pTags[i].innerHTML + '
'; const button = pTags[i].outerHTML.replace(/

/g, ''); innerElements += button.replace(/<\/p>/g, ''); }