Commit c395c89410dba096bd2c95c1b7aa0e70c2b6ccc8
support callback for after confirming message
Dominic Tarr committed on 6/20/2016, 2:37:31 AMParent: f6372a0b47a15d936a760ae37971796e6d433f76
Files changed
modules/message-confirm.js | changed |
modules/message-confirm.js | ||
---|---|---|
@@ -7,15 +7,17 @@ | ||
7 | 7 | |
8 | 8 | var publish = plugs.first(exports.publish = []) |
9 | 9 | var message_content = plugs.first(exports.message_content = []) |
10 | 10 | |
11 | -exports.message_confirm = function (content, sbot) { | |
11 | +exports.message_confirm = function (content, cb) { | |
12 | 12 | |
13 | + cb = cb || function () {} | |
14 | + | |
13 | 15 | var lb = lightbox() |
14 | 16 | document.body.appendChild(lb) |
15 | 17 | |
16 | 18 | var okay = h('button', 'okay', {onclick: function () { |
17 | - publish(content); lb.remove() | |
19 | + publish(content); lb.remove(); cb(null, content) | |
18 | 20 | }}) |
19 | 21 | |
20 | 22 | var cancel = h('button', 'cancel', {onclick: function () { |
21 | 23 | lb.remove() |
@@ -50,4 +52,5 @@ | ||
50 | 52 | |
51 | 53 | |
52 | 54 | |
53 | 55 | |
56 | + |
Built with git-ssb-web