clicking favorites puts into input

This commit is contained in:
SpikeHD 2022-04-20 23:12:15 -07:00
parent 18db67393b
commit ddca421b29
2 changed files with 12 additions and 0 deletions

View File

@ -153,6 +153,12 @@ async function handleFavoriteInput() {
}
}
async function setIp(ip) {
const ipInput = document.querySelector('#ip')
ipInput.value = ip
}
async function handleFavoriteList() {
const ipArr = await getFavIps()
const ipList = document.querySelector('#ipList')
@ -167,6 +173,7 @@ async function handleFavoriteList() {
for (const ip of ipArr) {
const elm = document.createElement('li')
elm.innerHTML = ip
elm.addEventListener('click', () => setIp(ip))
list.appendChild(elm)
}

View File

@ -36,6 +36,11 @@ body {
border-bottom: 1px solid #ccc;
}
#ipList li:hover {
color: #ffc61e;
cursor: pointer;
}
#ipList li:last-child {
border-bottom: none;
}