changeset 351:2ad8022d17a7 Dev_main

Revert revision 349 regarding change to enter behaviour: enter in a dialog box goes to next question/message, starts test or submits answers, rather than to create a new line / carriage return.
author Brecht De Man <b.deman@qmul.ac.uk>
date Mon, 23 Nov 2015 16:04:47 +0000
parents b448ed356355
children 2b1aa8be61b0 ff4998e9a005
files core.js
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core.js	Mon Nov 23 16:02:37 2015 +0000
+++ b/core.js	Mon Nov 23 16:04:47 2015 +0000
@@ -190,6 +190,12 @@
 				textArea.rows = "10";
 				break;
 			}
+			document.onkeydown=function(){
+				if(window.event.keyCode=='13'){ // when you hit enter
+					window.event.preventDefault(); // don't make newline
+					popup.proceedClicked(); // go to the next window (or start the test or submit)
+				}
+			}
 			this.popupResponse.appendChild(textArea);
 			textArea.focus();
 		} else if (node.type == 'checkbox') {