From 9fea0977b3fd2f1ce6182df55b8ccd78e8147663 Mon Sep 17 00:00:00 2001 From: Miguel BarĂ£o Date: Sun, 22 Apr 2018 00:42:08 +0100 Subject: [PATCH] - fixed codemirror submit --- static/js/topic.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/topic.js b/static/js/topic.js index 3fcdaeb..ecaab71 100644 --- a/static/js/topic.js +++ b/static/js/topic.js @@ -59,7 +59,9 @@ function getQuestion() { // Send answer and receive a response. // The response can be a new_question or a shake if the answer is wrong. function postQuestion() { - editor.save(); + if (typeof editor === 'object') + editor.save(); + $.ajax({ type: "POST", url: "/question", -- libgit2 0.21.2