diff --git a/blocks/imageshyperlink/imageshyperlink.js b/blocks/imageshyperlink/imageshyperlink.js index 347a6714..61fae6f8 100644 --- a/blocks/imageshyperlink/imageshyperlink.js +++ b/blocks/imageshyperlink/imageshyperlink.js @@ -1,21 +1,20 @@ -import { readBlockConfig } from '../../scripts/aem.js'; /** * loads and decorates the footer * @param {Element} block The footer block element */ export default async function decorate(block) { - const anchorEl = document.createElement("a"); - let refAnchorEl = block.querySelector("a"); - let pic = block.querySelector("picture"); + const anchorEl = document.createElement('a'); + const refAnchorEl = block.querySelector('a'); + const pic = block.querySelector('picture'); if (refAnchorEl) { - refAnchorEl.hasAttribute("href") && anchorEl.setAttribute("href", refAnchorEl.getAttribute("href")); - refAnchorEl.getAttribute("title") && anchorEl.setAttribute("title", refAnchorEl.getAttribute("title")); - refAnchorEl.getAttribute("alt") && anchorEl.setAttribute("alt", refAnchorEl.getAttribute("alt")); + refAnchorEl.hasAttribute('href') && anchorEl.setAttribute('href', refAnchorEl.getAttribute('href')); + refAnchorEl.getAttribute('title') && anchorEl.setAttribute('title', refAnchorEl.getAttribute('title')); + refAnchorEl.getAttribute('alt') && anchorEl.setAttribute('alt', refAnchorEl.getAttribute('alt')); anchorEl.appendChild(pic); - block.textContent = ""; + block.textContent = ''; block.append(anchorEl); } else { - block.textContent = ""; + block.textContent = ''; block.append(pic); } -} \ No newline at end of file +}