Browse Source

fix subwindow eventhandler releasing on pagenav for PMs

Paul Frazee 4 years ago
parent
commit
9b6fac6a6b
2 changed files with 4 additions and 4 deletions
  1. 2
    1
      ui/lib/com/pm-form.js
  2. 2
    3
      ui/lib/ui/subwindows.js

+ 2
- 1
ui/lib/com/pm-form.js View File

@@ -15,7 +15,8 @@ var markdown = require('../markdown')
15 15
 var mentionslib = require('../mentions')
16 16
 var social = require('../social-graph')
17 17
 
18
-module.exports = function (opts) {
18
+module.exports = function (opts, h2) {
19
+  h = h2 || h
19 20
 
20 21
   var recipients = []
21 22
   var placeholder = (opts && opts.placeholder) ? opts.placeholder : ''

+ 2
- 3
ui/lib/ui/subwindows.js View File

@@ -23,7 +23,7 @@ module.exports.subwindow = function (el, title, opts) {
23 23
       h2('a', { href: '#', onclick: oncollapsetoggle }, collapseToggleIcon),
24 24
       h2('a.close', { href: '#', onclick: onclose }, com.icon('remove'))
25 25
     ),
26
-    h2('.subwindow-body', el)
26
+    h2('.subwindow-body', (typeof el == 'function' ? el(h2) : el))
27 27
   )
28 28
   document.body.appendChild(subwindow)
29 29
 
@@ -106,8 +106,7 @@ module.exports.pm = function (opts) {
106 106
 
107 107
   opts = opts || {}
108 108
   opts.onpost = onpost
109
-  var form = com.pmForm(opts)
110
-  var sw = makeSubwindow(form, 'Secret Message', { icon: 'lock', help: 'secret-messages' })
109
+  var sw = makeSubwindow(com.pmForm.bind(null, opts), 'Secret Message', { icon: 'lock', help: 'secret-messages' })
111 110
   try { form.querySelector('input').focus() } catch (e) {}
112 111
 
113 112
   // handlers

Loading…
Cancel
Save