Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration tables to list #13

Open
UlisesGascon opened this issue Aug 15, 2018 · 0 comments
Open

Migration tables to list #13

UlisesGascon opened this issue Aug 15, 2018 · 0 comments
Assignees
Labels
💪 enhancement New feature or request
Milestone

Comments

@UlisesGascon
Copy link
Member

const tables = document.querySelectorAll(".menu");
tables.forEach(table => {
	let finalMenu = '<ul class="section-menu">'
	const rows = table.querySelectorAll("tr")
	rows.forEach(row => {
		const linkSelector = row.querySelector("a")
		const textSelector = row.querySelector("td:last-child")
		
		if(linkSelector && textSelector) {
			linkSelector.removeAttribute("accesskey")
			const link = linkSelector.outerHTML;
			const text = textSelector.innerText;
			finalMenu += `<li>${link}<span>${text}</span></li>`
		}

	})
	finalMenu += '</ul>';
	table.outerHTML = finalMenu;
})
@UlisesGascon UlisesGascon added this to the v1.0.0 milestone Aug 15, 2018
KoolTheba added a commit that referenced this issue Aug 15, 2018
@UlisesGascon UlisesGascon added the 💪 enhancement New feature or request label Aug 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants