Commit 1fd3c2d9148ba9ea22b04eabc592afe3ff16dabe
use message_compose via firstPlug not decorate
Dominic Tarr committed on 5/20/2016, 8:06:28 PMParent: 7b8459c024b593664fa22d32c9b9bcccfe02a2fa
Files changed
modules/compose.js | changed |
modules/main.js | changed |
modules/thread.js | changed |
modules/compose.js | ||
---|---|---|
@@ -10,11 +10,9 @@ | ||
10 | 10 | exports.message_content = [] |
11 | 11 | exports.message_confirm = [] |
12 | 12 | |
13 | 13 | //this decorator expects to be the first |
14 | -exports.message_compose = function (el, meta, sbot) { | |
15 | - if(el) return el | |
16 | - | |
14 | +exports.message_compose = function (meta, sbot) { | |
17 | 15 | meta = meta || {} |
18 | 16 | if(!meta.type) throw new Error('message must have type') |
19 | 17 | var ta = h('textarea') |
20 | 18 | //h('pre.editable.fixed', 'HELLO') |
@@ -64,4 +62,5 @@ | ||
64 | 62 | |
65 | 63 | |
66 | 64 | |
67 | 65 | |
66 | + |
modules/main.js | ||
---|---|---|
@@ -7,11 +7,9 @@ | ||
7 | 7 | exports.screen_view = function (path, sbot) { |
8 | 8 | if(path === '/') { |
9 | 9 | var content = h('div.column') |
10 | 10 | var div = h('div.column', {style: {'overflow':'auto'}}, |
11 | - u.decorate(exports.message_compose, {type: 'post'}, function (d, e, v) { | |
12 | - return d(e, v, sbot) | |
13 | - }), | |
11 | + u.firstPlug(exports.message_compose, {type: 'post'}, sbot), | |
14 | 12 | content |
15 | 13 | ) |
16 | 14 | var render = ui.createRenderers(exports.message_render, sbot) |
17 | 15 | |
@@ -37,4 +35,5 @@ | ||
37 | 35 | |
38 | 36 | |
39 | 37 | |
40 | 38 | |
39 | + |
modules/thread.js | ||
---|---|---|
@@ -64,12 +64,9 @@ | ||
64 | 64 | if(recps && thread[0].value.private) |
65 | 65 | meta.recps = recps |
66 | 66 | |
67 | 67 | div.appendChild( |
68 | - h('div', | |
69 | - u.decorate(exports.message_compose, meta, function (d, e, v) { | |
70 | - return d(e, v, sbot) | |
71 | - })) | |
68 | + h('div', u.firstPlug(exports.message_compose, meta, sbot)) | |
72 | 69 | ) |
73 | 70 | }) |
74 | 71 | |
75 | 72 | return div |
@@ -81,7 +78,4 @@ | ||
81 | 78 | exports.message_compose = [] |
82 | 79 | exports.message_unbox = [] |
83 | 80 | |
84 | 81 | |
85 | - | |
86 | - | |
87 | - |
Built with git-ssb-web