mirror of
https://github.com/Grasscutters/GrassClipper.git
synced 2024-11-16 04:45:34 +00:00
clicking favorites puts into input
This commit is contained in:
parent
18db67393b
commit
ddca421b29
@ -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)
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,11 @@ body {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#ipList li:hover {
|
||||
color: #ffc61e;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#ipList li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user