diff --git a/app/assets/javascripts/questionbox/all.coffee b/app/assets/javascripts/questionbox/all.coffee index 31d51ee0..9178123b 100644 --- a/app/assets/javascripts/questionbox/all.coffee +++ b/app/assets/javascripts/questionbox/all.coffee @@ -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' \ No newline at end of file diff --git a/app/assets/javascripts/questionbox/user.coffee b/app/assets/javascripts/questionbox/user.coffee index 77c8b113..32577b9d 100644 --- a/app/assets/javascripts/questionbox/user.coffee +++ b/app/assets/javascripts/questionbox/user.coffee @@ -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' \ No newline at end of file