summaryrefslogtreecommitdiff
path: root/yaksh/static
diff options
context:
space:
mode:
authorankitjavalkar2017-10-24 16:43:27 +0530
committerankitjavalkar2017-10-25 17:29:53 +0530
commit8b65fe7674b0d6d01253d51be605777e4e9b5a82 (patch)
tree3a4c858bba5667cca00815cfb0cd794723439a1b /yaksh/static
parent97a277cf5b86f60525f94302d5b04de420ad7212 (diff)
downloadonline_test-8b65fe7674b0d6d01253d51be605777e4e9b5a82.tar.gz
online_test-8b65fe7674b0d6d01253d51be605777e4e9b5a82.tar.bz2
online_test-8b65fe7674b0d6d01253d51be605777e4e9b5a82.zip
Fix the Reset Answer javascript and rename it to Undo Changes
Diffstat (limited to 'yaksh/static')
-rw-r--r--yaksh/static/yaksh/js/requesthandler.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/yaksh/static/yaksh/js/requesthandler.js b/yaksh/static/yaksh/js/requesthandler.js
index 9fcf5b6..7ff90df 100644
--- a/yaksh/static/yaksh/js/requesthandler.js
+++ b/yaksh/static/yaksh/js/requesthandler.js
@@ -83,6 +83,7 @@ function ajax_check_code(url, method_type, data_type, data, uid) {
}
var global_editor = {};
+
$(document).ready(function(){
// Codemirror object, language modes and initial content
// Get the textarea node
@@ -113,14 +114,17 @@ $(document).ready(function(){
// Setting code editors initial content
global_editor.editor.setValue(init_val);
- function reset_editor() {
+ $('#code').submit(function(e) {
+ lock_screen();
+ var data = $(this).serializeArray();
+ ajax_check_code($(this).attr("action"), "POST", "html", data, null)
+ e.preventDefault(); // To stop the default form submission.
+ });
+
+ reset_editor = function() {
global_editor.editor.setValue(init_val);
global_editor.editor.clearHistory();
}
- $('#code').submit(function(e) {
- lock_screen();
- var data = $(this).serializeArray();
- ajax_check_code($(this).attr("action"), "POST", "html", data, null)
- e.preventDefault(); // To stop the default form submission.
- });
+
+
});