mirror of
https://github.com/Grasscutters/GrassClipper.git
synced 2024-08-14 13:11:48 +08: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() {
|
async function handleFavoriteList() {
|
||||||
const ipArr = await getFavIps()
|
const ipArr = await getFavIps()
|
||||||
const ipList = document.querySelector('#ipList')
|
const ipList = document.querySelector('#ipList')
|
||||||
@ -167,6 +173,7 @@ async function handleFavoriteList() {
|
|||||||
for (const ip of ipArr) {
|
for (const ip of ipArr) {
|
||||||
const elm = document.createElement('li')
|
const elm = document.createElement('li')
|
||||||
elm.innerHTML = ip
|
elm.innerHTML = ip
|
||||||
|
elm.addEventListener('click', () => setIp(ip))
|
||||||
list.appendChild(elm)
|
list.appendChild(elm)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,11 @@ body {
|
|||||||
border-bottom: 1px solid #ccc;
|
border-bottom: 1px solid #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ipList li:hover {
|
||||||
|
color: #ffc61e;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
#ipList li:last-child {
|
#ipList li:last-child {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user