A bit rude of the QR to remove focus when the focus wasn't on the QR.

This commit is contained in:
ccd0 2017-02-06 21:21:37 -08:00
parent a0bfe1b1f4
commit 8191b4c859

View File

@ -146,7 +146,7 @@ QR =
return return
QR.nodes.el.hidden = true QR.nodes.el.hidden = true
QR.cleanNotifications() QR.cleanNotifications()
d.activeElement.blur() QR.blur()
$.rmClass QR.nodes.el, 'dump' $.rmClass QR.nodes.el, 'dump'
$.addClass QR.shortcut, 'disabled' $.addClass QR.shortcut, 'disabled'
new QR.post true new QR.post true
@ -168,7 +168,7 @@ QR =
getComputedStyle(el).visibility isnt 'hidden' and el.getBoundingClientRect().bottom > 0 getComputedStyle(el).visibility isnt 'hidden' and el.getBoundingClientRect().bottom > 0
hide: -> hide: ->
d.activeElement.blur() QR.blur()
$.addClass QR.nodes.el, 'autohide' $.addClass QR.nodes.el, 'autohide'
QR.nodes.autohide.checked = true QR.nodes.autohide.checked = true
@ -182,6 +182,9 @@ QR =
else else
QR.unhide() QR.unhide()
blur: ->
d.activeElement.blur() if QR.nodes.el.contains(d.activeElement)
toggleSJIS: (e) -> toggleSJIS: (e) ->
e.preventDefault() e.preventDefault()
Conf['sjisPreview'] = !Conf['sjisPreview'] Conf['sjisPreview'] = !Conf['sjisPreview']