Allow editing of settings
This commit is contained in:
parent
3fcb1bc36e
commit
8d976488ee
@ -25,7 +25,7 @@ func main() {
|
|||||||
count++
|
count++
|
||||||
println(count, user.Nick)
|
println(count, user.Nick)
|
||||||
|
|
||||||
user.SetNick(user.Nick)
|
user.ForceSetNick(user.Nick)
|
||||||
|
|
||||||
if user.Email != "" {
|
if user.Email != "" {
|
||||||
user.SetEmail(user.Email)
|
user.SetEmail(user.Email)
|
||||||
|
@ -30,6 +30,7 @@ export class AnimeNotifier {
|
|||||||
})
|
})
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(html => Diff.innerHTML(this.app.content, html))
|
.then(html => Diff.innerHTML(this.app.content, html))
|
||||||
|
.then(() => this.app.emit("DOMContentLoaded"))
|
||||||
}
|
}
|
||||||
|
|
||||||
loading(isLoading: boolean) {
|
loading(isLoading: boolean) {
|
||||||
@ -42,13 +43,17 @@ export class AnimeNotifier {
|
|||||||
|
|
||||||
updateActions() {
|
updateActions() {
|
||||||
for(let element of findAll("action")) {
|
for(let element of findAll("action")) {
|
||||||
|
if(element["action assigned"]) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
let actionName = element.dataset.action
|
let actionName = element.dataset.action
|
||||||
|
|
||||||
element.addEventListener(element.dataset.trigger, e => {
|
element.addEventListener(element.dataset.trigger, e => {
|
||||||
actions[actionName](this, element, e)
|
actions[actionName](this, element, e)
|
||||||
})
|
})
|
||||||
|
|
||||||
element.classList.remove("action")
|
element["action assigned"] = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +48,11 @@ export class Diff {
|
|||||||
a.setAttribute(attrib.name, b.getAttribute(attrib.name))
|
a.setAttribute(attrib.name, b.getAttribute(attrib.name))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Special case: Apply state of input elements
|
||||||
|
if(a !== document.activeElement && a instanceof HTMLInputElement && b instanceof HTMLInputElement) {
|
||||||
|
a.value = b.value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Diff.childNodes(a, b)
|
Diff.childNodes(a, b)
|
||||||
|
@ -48,6 +48,8 @@ export function save(arn: AnimeNotifier, input: HTMLInputElement | HTMLTextAreaE
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
arn.loading(false)
|
arn.loading(false)
|
||||||
input.disabled = false
|
input.disabled = false
|
||||||
|
|
||||||
|
return arn.reloadContent()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user