From 4919c90ab191b3fe0cd1379d549666f9d398a638 Mon Sep 17 00:00:00 2001 From: Hitoshi Tominaga Date: Wed, 22 Aug 2018 19:14:00 +0900 Subject: [PATCH] Update jspsych-external-html.js I found a minor bug on line 69. Error: if (trial.cont_key) { document.removeEventListener('keydown', key_listener); } Correct: if (trial.cont_key) { display_element.removeEventListener('keydown', key_listener); } Because of this, some eventListeners continue working after finishing this plugin. --- plugins/jspsych-external-html.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/jspsych-external-html.js b/plugins/jspsych-external-html.js index a3d2e0ca..5b86e906 100644 --- a/plugins/jspsych-external-html.js +++ b/plugins/jspsych-external-html.js @@ -66,7 +66,7 @@ jsPsych.plugins['external-html'] = (function() { var t0 = (new Date()).getTime(); var finish = function() { if (trial.check_fn && !trial.check_fn(display_element)) { return }; - if (trial.cont_key) { document.removeEventListener('keydown', key_listener); } + if (trial.cont_key) { display_element.removeEventListener('keydown', key_listener); } var trial_data = { rt: (new Date()).getTime() - t0, url: trial.url