Add event + add job form
- Modified handlers to catch errors - Added placeholder "No location added", etc. messages to Job/Event cards - Added EventForm.js and JobForm.js for adding - EventForm and JobForm are animated to slide up from bottom - Modified openProfile/closeProfile logic - Fixed SidebarItem().onClick() firing twice bug (switched to .onTap) - Profile is now animated to slide up from the bottom
This commit is contained in:
@@ -16,7 +16,6 @@ class AppWindowContainer extends Shadow {
|
||||
.gap(0)
|
||||
|
||||
Profile()
|
||||
.display("none")
|
||||
.zIndex(3)
|
||||
})
|
||||
.height(100, pct)
|
||||
@@ -26,11 +25,13 @@ class AppWindowContainer extends Shadow {
|
||||
}
|
||||
|
||||
openProfile() {
|
||||
this.$("profile-").display("")
|
||||
this.$("profile-").top(20, px)
|
||||
this.$("profile-").pointerEvents("auto")
|
||||
}
|
||||
|
||||
closeProfile() {
|
||||
this.$("profile-").display("none")
|
||||
this.$("profile-").top(100, vh)
|
||||
this.$("profile-").pointerEvents("none")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,9 @@ class SearchBar extends Shadow {
|
||||
.marginBottom(1, em)
|
||||
.border("1px solid var(--accent)")
|
||||
.borderRadius(15, px)
|
||||
.onTap(() => {
|
||||
this.handleAdd()
|
||||
})
|
||||
})
|
||||
.width(100, pct)
|
||||
.horizontalAlign("center")
|
||||
@@ -64,6 +67,20 @@ class SearchBar extends Shadow {
|
||||
})
|
||||
}
|
||||
|
||||
handleAdd() {
|
||||
const app = global.currentApp()
|
||||
switch (app) {
|
||||
case "Jobs":
|
||||
$("jobform-").toggle()
|
||||
break;
|
||||
case "Events":
|
||||
$("eventform-").toggle()
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
dispatchSearchEvent(searchText) {
|
||||
const app = global.currentApp();
|
||||
switch (app) {
|
||||
|
||||
@@ -8,14 +8,15 @@ class Sidebar extends Shadow {
|
||||
.fontWeight("bold")
|
||||
.fontFamily("Arial")
|
||||
.marginLeft(2, em)
|
||||
.onClick(function (done) {
|
||||
.onTap(function (done) {
|
||||
console.log("hello")
|
||||
if(done) {
|
||||
if (this.innerText === "Logout") {
|
||||
global.onLogout()
|
||||
return
|
||||
} else if (this.innerText === "Profile") {
|
||||
$("appwindowcontainer-").openProfile()
|
||||
$("sidebar-").close()
|
||||
$("sidebar-").toggle()
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -41,12 +42,6 @@ class Sidebar extends Shadow {
|
||||
.zIndex(3)
|
||||
}
|
||||
|
||||
close() {
|
||||
if(this.style.right !== "-71vw") {
|
||||
this.style.right = "-71vw"
|
||||
}
|
||||
}
|
||||
|
||||
toggle() {
|
||||
if(this.style.right === "-71vw") {
|
||||
this.style.right = "0vw"
|
||||
|
||||
Reference in New Issue
Block a user