Commit 49b26bd61308636377cd0415065fedba69c8b4d7
only allow one composer to launch at a time
Ev Bogue committed on 5/25/2018, 9:15:26 PMParent: e55f2b6f8739b7b56427b8bbdab3f5e3802ec8b0
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -15,13 +15,16 @@ | ||
15 | 15 | h('li', h('a', {href: '#' + id}, h('span.avatar--small', avatar.image(id)))), |
16 | 16 | h('li', h('a', {href: '#' + id}, avatar.name(id))), |
17 | 17 | h('li', h('a', 'Compose', { |
18 | 18 | onclick: function () { |
19 | - var currentScreen = document.getElementById('screen') | |
20 | - var opts = {} | |
21 | - opts.type = 'post' | |
22 | - var composer = h('div.content#composer', h('div.message', compose(opts))) | |
23 | - currentScreen.firstChild.insertBefore(composer, currentScreen.firstChild.firstChild) | |
19 | + if (document.getElementById('composer')) { return } | |
20 | + else { | |
21 | + var currentScreen = document.getElementById('screen') | |
22 | + var opts = {} | |
23 | + opts.type = 'post' | |
24 | + var composer = h('div.content#composer', h('div.message', compose(opts))) | |
25 | + currentScreen.firstChild.insertBefore(composer, currentScreen.firstChild.firstChild) | |
26 | + } | |
24 | 27 | } |
25 | 28 | })), |
26 | 29 | h('li', h('a', {href: '#'}, 'Public')), |
27 | 30 | h('li', h('a', {href: '#private' }, 'Private')), |
Built with git-ssb-web