Commit a1bbae564538469f36bbc2ec762417b265367186
Merge branch 'disable-private-blobs'
mix irving committed on 8/18/2017, 7:42:38 AMParent: ab05441c8dcd6cad002d31650852562da523e0c2
Parent: b361e2bf3aa5a852f1427695f6377cf100494224
Files changed
message/html/compose.js | changed |
message/html/compose.js | ||
---|---|---|
@@ -66,23 +66,30 @@ | ||
66 | 66 | placeholder |
67 | 67 | }) |
68 | 68 | textArea.publish = publish // TODO: fix - clunky api for the keyboard shortcut to target |
69 | 69 | |
70 | - var fileInput = api.blob.html.input(file => { | |
71 | - files.push(file) | |
72 | - filesById[file.link] = file | |
70 | + var fileInput | |
71 | + if(!meta.recps) { | |
72 | + fileInput = api.blob.html.input(file => { | |
73 | + files.push(file) | |
74 | + filesById[file.link] = file | |
73 | 75 | |
74 | - var embed = file.type.match(/^image/) ? '!' : '' | |
75 | - var spacer = embed ? '\n' : ' ' | |
76 | - var insertLink = spacer + embed + '[' + file.name + ']' + '(' + file.link + ')' + spacer | |
76 | + var embed = file.type.match(/^image/) ? '!' : '' | |
77 | + var spacer = embed ? '\n' : ' ' | |
78 | + var insertLink = spacer + embed + '[' + file.name + ']' + '(' + file.link + ')' + spacer | |
77 | 79 | |
78 | - var pos = textArea.selectionStart | |
79 | - textArea.value = textArea.value.slice(0, pos) + insertLink + textArea.value.slice(pos) | |
80 | + var pos = textArea.selectionStart | |
81 | + textArea.value = textArea.value.slice(0, pos) + insertLink + textArea.value.slice(pos) | |
80 | 82 | |
81 | - console.log('added:', file) | |
82 | - }) | |
83 | + console.log('added:', file) | |
84 | + }) | |
83 | 85 | |
84 | - fileInput.onclick = () => hasContent.set(true) | |
86 | + fileInput.onclick = () => hasContent.set(true) | |
87 | + } | |
88 | + // if fileInput is null, send button moves to the left side | |
89 | + // and we don't want that. | |
90 | + else | |
91 | + fileInput = h('span') | |
85 | 92 | |
86 | 93 | var publishBtn = h('Button -primary', { 'ev-click': publish }, strings.sendMessage) |
87 | 94 | |
88 | 95 | var actions = h('section.actions', [ |
@@ -190,4 +197,6 @@ | ||
190 | 197 | } |
191 | 198 | } |
192 | 199 | |
193 | 200 | |
201 | + | |
202 | + |
Built with git-ssb-web