git ssb

2+

ev / mvd



Commit 3bf3c7aca4c5ebf780ce5daee70c769f82f5ca26

make it possible to cancel message replies

Ev Bogue committed on 5/25/2018, 3:11:18 AM
Parent: 6156b3ef7ebddd045ec3648a267175653bd64c01

Files changed

compose.jschanged
render.jschanged
compose.jsView
@@ -102,8 +102,17 @@
102102 files.push(file)
103103 filesById[file.link] = file
104104 var embed = file.type.indexOf('image/') === 0 ? '!' : ''
105105 textarea.value += embed + '['+file.name+']('+file.link+')'
106 + }),
107 + h('button.btn', 'Cancel', {
108 + onclick: function () {
109 + var message = document.getElementById(opts.branch.substring(0,10))
110 + if (opts.updated)
111 + message.parentNode.removeChild(message)
112 + else
113 + message.parentNode.removeChild(message)
114 + }
106115 })
107116 )
108117
109118 composer.appendChild(container)
render.jsView
@@ -59,10 +59,11 @@
5959 buttons.appendChild(h('button.btn', 'Reply', {
6060 onclick: function () {
6161 //fallback = message.lastElementChild
6262 //console.log(fallback)
63- var compose = composer(reply)
64- message.replaceChild(compose, message.lastElementChild)
63 + var compose = h('div.message#' + reply.branch.substring(0, 10), composer(reply))
64 + message.parentNode.appendChild(compose)
65 + //message.replaceChild(compose, message.lastElementChild)
6566 }
6667 }))
6768 if (msg.value.author == id)
6869 buttons.appendChild(h('button.btn', 'Edit', {

Built with git-ssb-web