git ssb

3+

arj / patchbook



Commit 2e517d8b461be43cc33b63e9bf2831198fed3814

Add suggestions to review area as well

Anders Rune Jensen committed on 12/31/2017, 8:41:43 PM
Parent: 3ed43160a6f3f450250a6a1bc33b2b868cc460f9

Files changed

book/html/layout/detail.jschanged
book/html/layout/detail.mcsschanged
book/html/layout/detail.jsView
@@ -84,12 +84,29 @@
8484 ? '-expanded'
8585 : '-contracted'
8686 })
8787
88 + var getProfileSuggestions = api.about.async.suggest()
89 + var getChannelSuggestions = api.channel.async.suggest()
90 + var getEmojiSuggestions = api.emoji.async.suggest()
91 +
92 + let textArea = h('textarea', {'ev-input': e => value.set(e.target.value), value })
93 +
94 + let textAreaWrapper = h('span', textArea)
95 +
96 + addSuggest(textArea, (inputText, cb) => {
97 + const char = inputText[0]
98 + const wordFragment = inputText.slice(1)
99 +
100 + if (char === '@') cb(null, getProfileSuggestions(wordFragment))
101 + if (char === '#') cb(null, getChannelSuggestions(wordFragment))
102 + if (char === ':') cb(null, getEmojiSuggestions(wordFragment))
103 + }, {cls: 'PatchSuggest'})
104 +
88105 return h('div', { classList }, [
89106 h('div', name + ':'),
90107 when(isEditing,
91- h('textarea', {'ev-input': e => value.set(e.target.value), value }),
108 + textAreaWrapper,
92109 computed(value, api.message.html.markdown)
93110 )
94111 ])
95112 }
book/html/layout/detail.mcssView
@@ -50,12 +50,14 @@
5050 margin-bottom: 5px
5151 padding: 5px
5252 }
5353
54- textarea {
55- border: 1px solid gainsboro
56- width: 600px
57- height: 250px
54 + span {
55 + textarea {
56 + border: 1px solid gainsboro
57 + width: 600px
58 + height: 250px
59 + }
5860 }
5961 }
6062
6163 section {

Built with git-ssb-web