mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-20 23:02:05 +00:00
- Added util.js
- Fixed modal showing on addTorrent call
This commit is contained in:
parent
b0537d74c2
commit
edd306be1b
3 changed files with 11 additions and 1 deletions
|
|
@ -222,6 +222,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/gh/halfmoonui/halfmoon@1.0.4/js/halfmoon.min.js"></script>
|
||||
<script src="util.js"></script>
|
||||
<script src="animeHandler.js"></script>
|
||||
<script src="playerHandler.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/webtorrent@latest/webtorrent.min.js" defer></script>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ function addTorrent(magnet) {
|
|||
if (client.torrents.length >= maxTorrents) {
|
||||
client.remove(client.torrents[0].infoHash)
|
||||
}
|
||||
halfmoon.toggleModal("tsearch")
|
||||
halfmoon.hideModal("tsearch")
|
||||
document.location.href = "#player"
|
||||
client.add(magnet, async function (torrent) {
|
||||
video.src = ""
|
||||
|
|
|
|||
9
app/util.js
Normal file
9
app/util.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
halfmoon.showModal = id => {
|
||||
const t = document.getElementById(id)
|
||||
t && t.classList.add("show")
|
||||
}
|
||||
halfmoon.hideModal = id => {
|
||||
const t = document.getElementById(id)
|
||||
t && t.classList.remove("show")
|
||||
}
|
||||
|
||||
Loading…
Reference in a new issue