diff --git a/app/javascript/legacy/question.coffee b/app/javascript/legacy/question.coffee deleted file mode 100644 index 49b5f57d..00000000 --- a/app/javascript/legacy/question.coffee +++ /dev/null @@ -1,37 +0,0 @@ -$(document).on "keydown", "textarea#q-answer-text", (evt) -> - qid = $(this)[0].dataset.id - if evt.keyCode == 13 and evt.ctrlKey - # trigger warning: - $("button#q-answer-btn").trigger 'click' - - -$(document).on "click", "button#q-answer-btn", -> - btn = $(this) - btn.button "loading" - qid = btn[0].dataset.qId - $("textarea#q-answer-text").attr "readonly", "readonly" - - shareTo = [] - ($ "input[type=checkbox][name=share][data-q-id=#{qid}]:checked").each (i, share) -> - shareTo.push share.dataset.service - - $.ajax - url: '/ajax/answer' - type: 'POST' - dataType: 'json' - data: - id: qid - answer: $("textarea#q-answer-text[data-id=#{qid}]").val() - share: JSON.stringify shareTo - inbox: false - success: (data, status, jqxhr) -> - if data.success - $("div#q-answer-box").slideUp() - ($ "div#answers").prepend data.render - showNotification data.message, data.success - error: (jqxhr, status, error) -> - console.log jqxhr, status, error - showNotification translate('frontend.error.message'), false - complete: (jqxhr, status) -> - btn.button "reset" - $("textarea#q-answer-text").removeAttr "readonly" diff --git a/app/javascript/packs/legacy.coffee b/app/javascript/packs/legacy.coffee index 426c6ce0..83d3cb6a 100644 --- a/app/javascript/packs/legacy.coffee +++ b/app/javascript/packs/legacy.coffee @@ -26,7 +26,6 @@ import '../legacy/answerbox' import '../legacy/memes' import '../legacy/notifications' import '../legacy/pagination' -import '../legacy/question' import '../legacy/settings' import '../legacy/report' import '../legacy/locale-box'