Fix errors from changing QR shortcut before added to document.

This commit is contained in:
ccd0 2015-01-31 12:01:17 -08:00
parent a85d5b2335
commit bd742bcc35

View File

@ -14,7 +14,7 @@ QR =
@captcha = Captcha[if noscript then 'noscript' else 'v2'] @captcha = Captcha[if noscript then 'noscript' else 'v2']
if Conf['QR Shortcut'] if Conf['QR Shortcut']
sc = $.el 'a', @shortcut = sc = $.el 'a',
className: 'qr-shortcut fa fa-comment-o disabled' className: 'qr-shortcut fa fa-comment-o disabled'
textContent: 'QR' textContent: 'QR'
title: 'Quick Reply' title: 'Quick Reply'
@ -112,7 +112,7 @@ QR =
error: err error: err
return return
if Conf['QR Shortcut'] if Conf['QR Shortcut']
$.rmClass $('.qr-shortcut'), 'disabled' $.rmClass QR.shortcut, 'disabled'
close: -> close: ->
if QR.req if QR.req
@ -123,7 +123,7 @@ QR =
d.activeElement.blur() d.activeElement.blur()
$.rmClass QR.nodes.el, 'dump' $.rmClass QR.nodes.el, 'dump'
if Conf['QR Shortcut'] if Conf['QR Shortcut']
$.addClass $('.qr-shortcut'), 'disabled' $.addClass QR.shortcut, 'disabled'
new QR.post true new QR.post true
for post in QR.posts.splice 0, QR.posts.length - 1 for post in QR.posts.splice 0, QR.posts.length - 1
post.delete() post.delete()