git ssb

16+

Dominic / patchbay



Commit 30af2ef391b12dddb977c5c3dce6ba556f6f91f1

/posts keyboard nav

mix irving committed on 7/1/2018, 10:11:09 PM
Parent: 2ad00a30b030cc01724cbb7998058c8880da46c5

Files changed

app/page/posts.jschanged
app/page/posts.mcsschanged
app/sync/catch-keyboard-shortcut.jschanged
app/page/posts.jsView
@@ -162,9 +162,12 @@
162162
163163 return h('ThreadCard',
164164 {
165165 className,
166- attributes: { tabindex: '0' } // needed to be able to navigate and show focus()
166 + attributes: {
167 + tabindex: '0', // needed to be able to navigate and show focus()
168 + 'data-id': key // TODO do this with decorators?
169 + }
167170 }, [
168171 h('section.context', [
169172 h('div.avatar', root.avatar),
170173 h('div.name', root.author),
app/page/posts.mcssView
@@ -12,8 +12,9 @@
1212 ThreadCard {
1313 -loading {
1414 min-height: 20rem
1515 }
16 + outline: none
1617
1718 display: grid
1819 grid-template-columns: 8rem 1fr
1920 grid-gap: 2rem
@@ -105,5 +106,15 @@
105106 div.preview { margin-left: .5rem }
106107 }
107108 }
108109 }
110 + :focus {
111 + section.content-preview {
112 + div.root {
113 + div.Markdown {
114 + background: #6f0055
115 + transition: background .2s ease-in
116 + }
117 + }
118 + }
119 + }
109120 }
app/sync/catch-keyboard-shortcut.jsView
@@ -101,12 +101,13 @@
101101 }
102102
103103 function goToMessage (ev, { goTo }) {
104104 const msg = ev.target
105- if (!msg.classList.contains('Message')) return
106105
107- goTo(msg.dataset.id)
108- // TODO - rm the dataset.root decorator
106 + if (msg.dataset && msg.dataset.id) {
107 + goTo(msg.dataset.id)
108 + // TODO - rm the dataset.root decorator
109 + }
109110 }
110111
111112 function toggleRawMessage (ev) {
112113 const msg = ev.target

Built with git-ssb-web