[LON-CAPA-cvs] cvs: loncom /html/res/adm/pages/reactionresponse reaction_preview.js

damieng damieng at source.lon-capa.org
Thu Jan 5 10:17:18 EST 2017


damieng		Thu Jan  5 15:17:18 2017 EDT

  Modified files:              
    /loncom/html/res/adm/pages/reactionresponse	reaction_preview.js 
  Log:
  reaction preview: also fixing the syntax when the return key is used
  
Index: loncom/html/res/adm/pages/reactionresponse/reaction_preview.js
diff -u loncom/html/res/adm/pages/reactionresponse/reaction_preview.js:1.1 loncom/html/res/adm/pages/reactionresponse/reaction_preview.js:1.2
--- loncom/html/res/adm/pages/reactionresponse/reaction_preview.js:1.1	Wed Jan  4 20:09:17 2017
+++ loncom/html/res/adm/pages/reactionresponse/reaction_preview.js	Thu Jan  5 15:17:18 2017
@@ -275,6 +275,11 @@
         ta.value = that.to_capa(ta.value);
     };
     ta.addEventListener('blur', blur, false);
+    var keydown = function(e) {
+        if (e.keyCode == 13) // ENTER
+            ta.value = that.to_capa(ta.value);
+    };
+    ta.addEventListener('keydown', keydown, false);
     var focus = function(e) {
         if (ta.value != '') {
             if (ta.value != this.old_string) {




More information about the LON-CAPA-cvs mailing list