fix subwindow eventhandler releasing on pagenav for PMs
This commit is contained in:
parent
9a75883846
commit
9b6fac6a6b
@ -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 : ''
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user