1, 4: Fixing 404 after logged out, adding market entry
This commit is contained in:
@@ -64,12 +64,44 @@ class AppMenu extends Shadow {
|
||||
.gap(1.5, em)
|
||||
.paddingRight(2, em)
|
||||
|
||||
img("_/images/divider.svg", "40vw")
|
||||
img("/_/images/divider.svg", "40vw")
|
||||
.attr({
|
||||
"id": "divider",
|
||||
})
|
||||
})
|
||||
.gap(0.5, em)
|
||||
.onNavigate(() => {
|
||||
if(window.location.pathname === "/") {
|
||||
this.styleMaximized()
|
||||
$("app-window").close()
|
||||
} else {
|
||||
this.styleMinimized()
|
||||
$("app-window").open(this.selected)
|
||||
}
|
||||
})
|
||||
.onAppear(() => {
|
||||
Array.from(this.querySelectorAll("p")).forEach((el) => {
|
||||
el.addEventListener("mousedown", (e) => {
|
||||
el.classList.add("touched")
|
||||
})
|
||||
})
|
||||
window.addEventListener("mouseup", (e) => {
|
||||
let target = e.target
|
||||
if(!target.matches("app-menu p")) {
|
||||
return
|
||||
}
|
||||
|
||||
target.classList.remove("touched")
|
||||
|
||||
if(target.classList.contains("selected")) {
|
||||
this.selected = ""
|
||||
window.navigateTo("/")
|
||||
} else {
|
||||
this.selected = target.innerText
|
||||
window.navigateTo("/app/" + target.innerText.toLowerCase())
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
if(this.selected) {
|
||||
this.styleMinimized()
|
||||
@@ -95,35 +127,6 @@ class AppMenu extends Shadow {
|
||||
this.classList.add("minimized")
|
||||
$("#divider").style.display = "none"
|
||||
}
|
||||
|
||||
|
||||
connectedCallback() {
|
||||
Array.from(this.querySelectorAll("p")).forEach((el) => {
|
||||
el.addEventListener("mousedown", (e) => {
|
||||
el.classList.add("touched")
|
||||
})
|
||||
})
|
||||
window.addEventListener("mouseup", (e) => {
|
||||
let target = e.target
|
||||
if(!target.matches("app-menu p")) {
|
||||
return
|
||||
}
|
||||
|
||||
target.classList.remove("touched")
|
||||
|
||||
if(target.classList.contains("selected")) {
|
||||
this.selected = ""
|
||||
this.styleMaximized(target)
|
||||
window.navigateTo("/")
|
||||
$("app-window").close()
|
||||
} else {
|
||||
this.selected = target.innerText
|
||||
this.styleMinimized(target)
|
||||
window.navigateTo("/app/" + target.innerText.toLowerCase())
|
||||
$("app-window").open(target.innerText)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
, "app-menu")
|
||||
Reference in New Issue
Block a user