-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: resolves issues from issues list (#164)
* add transparent bg to news cards * fix homepage spacing * make sure all images are the same height * update template to use default image size in cards * fix news heading spacing * fix breadcrumb chevron colour * fix h2 line height * make page contnets sticky * fix divider spacing * ability to add or remove example links * make sure link wraps * script for creating page contents * make sure spacing matches between cards * update dropdown arrow * Restyled by prettier (#165) Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: Nathan Rogan <nathan.rogan@wmca.org.uk> Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Restyled.io <commits@restyled.io>
- Loading branch information
1 parent
aef5cad
commit a6a1340
Showing
14 changed files
with
126 additions
and
34 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
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
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
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
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
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
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
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
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
33 changes: 33 additions & 0 deletions
33
src/www/pages/templates/campaign-two-columns/campaign-template.js
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const pageContents = () => { | ||
const headings = document.querySelectorAll('.main h2'); | ||
|
||
headings.forEach(heading => { | ||
const str = heading.innerHTML; | ||
const linkStr = str.toLowerCase().replaceAll(' ', '-'); | ||
const link = `#${linkStr}`; | ||
|
||
// add id to all the h2 | ||
heading.setAttribute('id', linkStr); | ||
|
||
// function to decode htmlentities | ||
function decodeHtml(html) { | ||
const txt = document.createElement('textarea'); | ||
txt.innerHTML = html; | ||
return txt.value; | ||
} | ||
// function to add a link to the page contents | ||
function createMenuItem() { | ||
const li = document.createElement('a'); | ||
li.textContent = decodeHtml(str); | ||
li.setAttribute('href', link); | ||
return li; | ||
} | ||
|
||
// get the page contents | ||
const menu = document.querySelector('.wmcads-page-contents'); | ||
// add page contents link | ||
menu.appendChild(createMenuItem()); | ||
}); | ||
}; | ||
|
||
export default pageContents; |
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
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
Oops, something went wrong.