you can now answer a question by hitting ctrl+return

This commit is contained in:
nilsding 2014-12-07 18:33:26 +01:00
parent f260d6462f
commit c26b081cc0
1 changed files with 6 additions and 0 deletions

View File

@ -50,6 +50,12 @@ $(document).on "click", "button[name=qb-ask]", ->
btn.button "reset"
$("textarea[name=qb-question]").removeAttr "readonly"
$(document).on "keydown", "textarea[name=ib-answer]", (evt) ->
iid = $(this)[0].dataset.id
if evt.keyCode == 13 and evt.ctrlKey
# trigger warning:
$("button[name=ib-answer][data-ib-id=#{iid}]").trigger 'click'
$(document).on "click", "button[name=ib-answer]", ->
btn = $(this)
btn.button "loading"