Commit 51bb7f2c4da0239b8114b4f425ca3da89741c261
enter to post message, esc to cancel
Dominic Tarr committed on 5/29/2016, 11:17:08 AMParent: 86a733778b0428dc270a65273d76c6bb187dad06
Files changed
modules/message-confirm.js | changed |
modules/message-confirm.js | ||
---|---|---|
@@ -10,22 +10,46 @@ | ||
10 | 10 | |
11 | 11 | var lb = lightbox() |
12 | 12 | document.body.appendChild(lb) |
13 | 13 | |
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 | + | |
14 | 30 | lb.show(h('div.column', |
15 | 31 | u.firstPlug(exports.message_content, |
16 | 32 | {key: "DRAFT", value: {content: content}}, sbot |
17 | 33 | ) || 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) | |
27 | 35 | )) |
28 | 36 | |
37 | + okay.focus() | |
38 | + | |
39 | +// hidden.focus() | |
40 | + | |
29 | 41 | } |
30 | 42 | |
31 | 43 | |
44 | + | |
45 | + | |
46 | + | |
47 | + | |
48 | + | |
49 | + | |
50 | + | |
51 | + | |
52 | + | |
53 | + | |
54 | + | |
55 | + |
Built with git-ssb-web