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.
This commit is contained in:
Hitoshi Tominaga 2018-08-22 19:14:00 +09:00 committed by GitHub
parent 6eb7ec21ac
commit 4919c90ab1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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