fix subwindow eventhandler releasing on pagenav for PMs

This commit is contained in:
Paul Frazee 2015-09-29 11:03:32 -05:00
parent 9a75883846
commit 9b6fac6a6b
2 changed files with 4 additions and 4 deletions

View File

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

View File

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