Use anchor tags for navigation

This commit is contained in:
Misode
2020-09-22 22:35:59 +02:00
parent 248bce045a
commit 59c2d761b5
2 changed files with 5 additions and 3 deletions

View File

@@ -364,12 +364,13 @@ Promise.all([
const addGen = (output: HTMLElement) => (m: any) => {
output.insertAdjacentHTML('beforeend',
`<div class="generators-card${m.id === selected ? ' selected' : ''}">
`<a class="generators-card${m.id === selected ? ' selected' : ''}" href="${publicPath + m.id}">
${locale(m.name)}
${m.schema ? '' : '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M6.22 3.22a.75.75 0 011.06 0l4.25 4.25a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 010-1.06z"></path></svg>'}
</div>`)
output.lastChild?.addEventListener('click', evt => {
</a>`)
output.lastChild?.addEventListener('click', evt => {
reload(publicPath + m.id)
evt.preventDefault()
})
}