Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db71e22e authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

fix: remove not working for multiple elements

parent 00558203
Loading
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
document.addEventListener('DOMContentLoaded', function() {
	class ListNode {
		constructor(data) {
			this.data = data
			this.next = null
		}
	}

	let head = null
	const contents = document.getElementById('app-content').lastChild.children
	for (let index = 0; index < contents.length; index++) {
		const content = contents[index]
		const contentHeaderText = content.firstChild.innerHTML
		if (contentHeaderText.includes('Keyboard shortcuts') || contentHeaderText.includes('Navigation bar settings')) {
			content.remove()
			const tempHead = head
			let node = new ListNode(content)
			if (head == null) {
				head = node
			} else {
				node.next = head
				head = node
			}
		}
	}

	while(head != null) {
		let node = head
		head = node.next
		node.data.remove()
	}
})