From cdfe5564d64529cbac5bd6f88edf366aabce23e5 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sat, 3 Jan 2015 22:36:51 +0100 Subject: [PATCH] made C-RET work again --- app/assets/javascripts/question.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/question.coffee b/app/assets/javascripts/question.coffee index 9cfa2f76..09c26ecb 100644 --- a/app/assets/javascripts/question.coffee +++ b/app/assets/javascripts/question.coffee @@ -2,14 +2,14 @@ $(document).on "keydown", "textarea#q-answer", (evt) -> qid = $(this)[0].dataset.id if evt.keyCode == 13 and evt.ctrlKey # trigger warning: - $("button#q-answer[data-q-id=#{qid}]").trigger 'click' + $("button#q-answer").trigger 'click' $(document).on "click", "button#q-answer", -> btn = $(this) btn.button "loading" qid = btn[0].dataset.qId - $("textarea#q-answer[data-q=#{qid}]").attr "readonly", "readonly" + $("textarea#q-answer").attr "readonly", "readonly" shareTo = [] ($ "input[type=checkbox][name=share][data-q-id=#{qid}]:checked").each (i, share) -> @@ -34,4 +34,4 @@ $(document).on "click", "button#q-answer", -> showNotification "An error occurred, a developer should check the console for details", false complete: (jqxhr, status) -> btn.button "reset" - $("textarea#q-answer[data-id=#{qid}]").removeAttr "readonly" + $("textarea#q-answer").removeAttr "readonly"