git ssb

16+

Dominic / patchbay



Commit 51bb7f2c4da0239b8114b4f425ca3da89741c261

enter to post message, esc to cancel

Dominic Tarr committed on 5/29/2016, 11:17:08 AM
Parent: 86a733778b0428dc270a65273d76c6bb187dad06

Files changed

modules/message-confirm.jschanged
modules/message-confirm.jsView
@@ -10,22 +10,46 @@
1010
1111 var lb = lightbox()
1212 document.body.appendChild(lb)
1313
14+ var okay = h('button', 'okay', {onclick: function () {
15+ u.firstPlug(exports.publish, content, null, sbot)
16+ lb.remove()
17+ }})
18+
19+ var cancel = h('button', 'cancel', {onclick: function () {
20+ lb.remove()
21+ }})
22+
23+ var hidden = h('input', {style: {visible: 'hidden'}})
24+
25+
26+ okay.addEventListener('keydown', function (ev) {
27+ if(ev.keyCode === 27) cancel.click() //escape
28+ })
29+
1430 lb.show(h('div.column',
1531 u.firstPlug(exports.message_content,
1632 {key: "DRAFT", value: {content: content}}, sbot
1733 ) || h('pre', JSON.stringify(content, null, 2)),
18- h('div.row',
19- h('button', 'okay', {onclick: function () {
20- u.firstPlug(exports.publish, content, null, sbot)
21- lb.remove()
22- }}),
23- h('button', 'cancel', {onclick: function () {
24- lb.remove()
25- }})
26- )
34+ h('div.row', okay, cancel)
2735 ))
2836
37+ okay.focus()
38+
39+// hidden.focus()
40+
2941 }
3042
3143
44+
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+

Built with git-ssb-web