ES5 → 7: Use enhanced object properties
http://es6-features.org/#PropertyShorthand Instead of doing {"foo": foo, "bar": bar, ...}, we can just do {foo, bar} now. The function parameters of EventHandlers have all been renamed to camelCase to make use of this, as the JS style conventions intend. Other functions will follow in a later commit.
This commit is contained in:
@@ -34,8 +34,8 @@ Banner {
|
||||
}
|
||||
]
|
||||
|
||||
buttonCallbacks: {
|
||||
"accept": button => {
|
||||
buttonCallbacks: ({
|
||||
accept: button => {
|
||||
button.loading = true
|
||||
py.callClientCoro(
|
||||
chatPage.userId, "join", [chatPage.roomId], () => {
|
||||
@@ -43,12 +43,12 @@ Banner {
|
||||
})
|
||||
},
|
||||
|
||||
"decline": button => {
|
||||
decline: button => {
|
||||
button.loading = true
|
||||
py.callClientCoro(
|
||||
chatPage.userId, "room_leave", [chatPage.roomId], () => {
|
||||
button.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@@ -22,13 +22,13 @@ Banner {
|
||||
}
|
||||
]
|
||||
|
||||
buttonCallbacks: {
|
||||
"forget": button => {
|
||||
buttonCallbacks: ({
|
||||
forget: button => {
|
||||
button.loading = true
|
||||
py.callClientCoro(
|
||||
chatPage.userId, "room_forget", [chatPage.roomId], () => {
|
||||
button.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@@ -20,9 +20,9 @@ Banner {
|
||||
}
|
||||
]
|
||||
|
||||
buttonCallbacks: {
|
||||
"inspect": button => {
|
||||
buttonCallbacks: ({
|
||||
inspect: button => {
|
||||
print("show")
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user