logs-content: Added remove modal, fixed move up/down mutations
This commit is contained in:
@@ -5,13 +5,14 @@ module.exports = class {
|
||||
name: "",
|
||||
text: "",
|
||||
modal: null,
|
||||
removed: false,
|
||||
}
|
||||
|
||||
this.updatePost(input)
|
||||
}
|
||||
|
||||
open(modal) {
|
||||
this.state.modal == modal
|
||||
this.state.modal = modal
|
||||
}
|
||||
|
||||
close() {
|
||||
@@ -22,6 +23,11 @@ module.exports = class {
|
||||
this.emit("move", toPosition)
|
||||
}
|
||||
|
||||
remove() {
|
||||
this.state.removed = true
|
||||
this.emit("remove")
|
||||
}
|
||||
|
||||
onInput(input) {
|
||||
if (this.state == null) {
|
||||
return
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div class=["post", component.kindClass("post-type")]>
|
||||
<div if(!state.removed) class=["post", component.kindClass("post-type")]>
|
||||
<div class="post-meta-row">
|
||||
<div class="options color-menu">
|
||||
<a if(input.post.position != 1) on-click("move", input.post.position - 1)>Up</a>
|
||||
<a if(!input.last) on-click("move", input.post.position + 1)>Down</a>
|
||||
<a on-click("move", -1, true)>Up</a>
|
||||
<a on-click("move", +1, true)>Down</a>
|
||||
<!--<a on-click("open", "edit") >Edit</a>-->
|
||||
<!--<a on-click("open", "remove") >Remove</a>-->
|
||||
<a on-click("open", "remove")>Remove</a>
|
||||
</div>
|
||||
<post-meta kind="timestamp" value=input.post.time />
|
||||
<post-meta kind="nick" value=input.post.nick />
|
||||
@@ -23,4 +23,5 @@
|
||||
<div if(input.post.kind === "text") class="post-body color-text">
|
||||
<markdown class="post-content post-text" source=state.text />
|
||||
</div>
|
||||
<remove-post-modal enabled=(state.modal === "remove") post=input.post on-close("close") on-remove("remove") />
|
||||
</div>
|
||||
Reference in New Issue
Block a user