mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-08-18 07:47:47 +00:00
- Improved the code in util.js to not throw errors if halfmoon is removed in the future
This commit is contained in:
parent
edd306be1b
commit
54993f1b07
1 changed files with 9 additions and 7 deletions
16
app/util.js
16
app/util.js
|
|
@ -1,9 +1,11 @@
|
|||
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")
|
||||
if ((typeof halfmoon === "object" || typeof halfmoon === 'function') && (halfmoon !== null)) {
|
||||
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