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:
@@ -21,16 +21,16 @@ Item {
|
||||
{ name: "no", text: qsTr("No") },
|
||||
]
|
||||
|
||||
buttonCallbacks: {
|
||||
"yes": button => {
|
||||
buttonCallbacks: ({
|
||||
yes: button => {
|
||||
py.callCoro("save_account", [userId])
|
||||
pageStack.showPage("Default")
|
||||
},
|
||||
"no": button => {
|
||||
no: button => {
|
||||
py.callCoro("forget_account", [userId])
|
||||
pageStack.showPage("Default")
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
HLabel {
|
||||
text: qsTr(
|
||||
|
@@ -22,24 +22,21 @@ Item {
|
||||
{ name: "forgot", text: qsTr("Forgot?") }
|
||||
]
|
||||
|
||||
buttonCallbacks: {
|
||||
"register": button => {},
|
||||
buttonCallbacks: ({
|
||||
register: button => {},
|
||||
|
||||
"login": button => {
|
||||
login: button => {
|
||||
button.loading = true
|
||||
var args = [idField.text, passwordField.text]
|
||||
|
||||
py.callCoro("login_client", args, user_id => {
|
||||
pageStack.showPage(
|
||||
"RememberAccount",
|
||||
{"loginWith": loginWith, "userId": user_id}
|
||||
)
|
||||
pageStack.showPage("RememberAccount", {loginWith, user_id})
|
||||
button.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
"forgot": button => {}
|
||||
}
|
||||
forgot: button => {}
|
||||
})
|
||||
|
||||
HRowLayout {
|
||||
spacing: signInBox.margins * 1.25
|
||||
|
Reference in New Issue
Block a user