C-<RET> for asking questions

This commit is contained in:
nilsding 2014-12-10 20:54:12 +01:00
parent 93540e0969
commit 883bedcbf1
2 changed files with 17 additions and 4 deletions

View File

@ -22,7 +22,8 @@ $(document).on "click", "button[name=qb-all-ask]", ->
btn.button "reset"
$("textarea[name=qb-all-question]").removeAttr "readonly"
# for that promotional thing
$(document).on "click", "button#new-question", ->
$("div#question-box").show()
$("div#question-box-promote").hide()
# see GitHub issue #2
($ document).on "keydown", "textarea[name=qb-all-question]", (evt) ->
if evt.keyCode == 13 and evt.ctrlKey
($ "button[name=qb-all-ask]").trigger 'click'

View File

@ -27,3 +27,15 @@ $(document).on "click", "button[name=qb-ask]", ->
complete: (jqxhr, status) ->
btn.button "reset"
$("textarea[name=qb-question]").removeAttr "readonly"
# for that promotional thing
$(document).on "click", "button#new-question", ->
$("div#question-box").show()
$("div#question-box-promote").hide()
# see GitHub issue #2
($ document).on "keydown", "textarea[name=qb-question]", (evt) ->
if evt.keyCode == 13 and evt.ctrlKey
($ "button[name=qb-ask]").trigger 'click'