Commit 3bf3c7aca4c5ebf780ce5daee70c769f82f5ca26
make it possible to cancel message replies
Ev Bogue committed on 5/25/2018, 3:11:18 AMParent: 6156b3ef7ebddd045ec3648a267175653bd64c01
Files changed
compose.js | changed |
render.js | changed |
compose.js | |||
---|---|---|---|
@@ -102,8 +102,17 @@ | |||
102 | 102 … | files.push(file) | |
103 | 103 … | filesById[file.link] = file | |
104 | 104 … | var embed = file.type.indexOf('image/') === 0 ? '!' : '' | |
105 | 105 … | 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 … | + } | ||
106 | 115 … | }) | |
107 | 116 … | ) | |
108 | 117 … | ||
109 | 118 … | composer.appendChild(container) |
render.js | ||
---|---|---|
@@ -59,10 +59,11 @@ | ||
59 | 59 … | buttons.appendChild(h('button.btn', 'Reply', { |
60 | 60 … | onclick: function () { |
61 | 61 … | //fallback = message.lastElementChild |
62 | 62 … | //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) | |
65 | 66 … | } |
66 | 67 … | })) |
67 | 68 … | if (msg.value.author == id) |
68 | 69 … | buttons.appendChild(h('button.btn', 'Edit', { |
Built with git-ssb-web