generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleared lint issues imageshyperlink1
- Loading branch information
1 parent
a352a9f
commit 634b36b
Showing
1 changed file
with
9 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} | ||
} |