git ssb

16+

Dominic / patchbay



Commit 0deca1a2dd623557c84798484b3fcdedb6a923cb

make messages focusable - when hit enter, search for the next item under current and click it

Dominic Tarr committed on 6/18/2016, 10:15:35 AM
Parent: d0145eaaeadda8e425fdf9f4bca039dbc19b9ec5

Files changed

modules/message.jschanged
modules/timestamp.jschanged
modules/message.jsView
@@ -30,20 +30,32 @@
3030 ))
3131 })
3232 )
3333
34- return h('div.message.column',
34+ var msg = h('div.message.column',
3535 h('div.title.row',
3636 h('div.avatar', avatar(msg.value.author)),
3737 h('div.message_meta.row', message_meta(msg))
3838 ),
3939 h('div.message_content', el),
4040 h('div.message_actions.row',
4141 h('div.actions', message_action(msg))
4242 ),
43- backlinks
43+ backlinks,
44+ {onkeydown: function (ev) {
45+ //on enter, hit first meta.
46+ if(ev.keyCode == 13) {
47+ msg.querySelector('.enter').click()
48+ }
49+ }}
4450 )
51+
52+ // ); hyperscript does not seem to set attributes correctly.
53+ msg.setAttribute('tabindex', '0')
54+
55+ return msg
4556 }
4657
4758
4859
4960
61+
modules/timestamp.jsView
@@ -1,6 +1,6 @@
11 var h = require('hyperscript')
22 var moment = require('moment')
33
44 exports.message_meta = function (msg) {
5- return h('a', {href: '#'+msg.key}, moment(msg.value.timestamp).fromNow())
5+ return h('a.enter', {href: '#'+msg.key}, moment(msg.value.timestamp).fromNow())
66 }

Built with git-ssb-web