mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
Array.from() -> Array.prototype.slice.call() in free sort and maxdiff plugins
This commit is contained in:
parent
3906daad54
commit
51ebc5449b
@ -348,7 +348,7 @@ class FreeSortPlugin implements JsPsychPlugin<Info> {
|
||||
let cur_in = false;
|
||||
|
||||
// draggable items
|
||||
const draggables = Array.from(
|
||||
const draggables = Array.prototype.slice.call(
|
||||
display_element.querySelectorAll<HTMLImageElement>(".jspsych-free-sort-draggable")
|
||||
);
|
||||
|
||||
|
@ -185,12 +185,12 @@ class MaxdiffPlugin implements JsPsychPlugin<Info> {
|
||||
// check response
|
||||
if (trial.required) {
|
||||
// Now check if one of both left and right have been enabled to allow submission
|
||||
var left_checked = Array.from(document.getElementsByName("left")).some(
|
||||
(c: HTMLInputElement) => c.checked
|
||||
);
|
||||
var right_checked = Array.from(document.getElementsByName("right")).some(
|
||||
(c: HTMLInputElement) => c.checked
|
||||
);
|
||||
var left_checked = Array.prototype.slice
|
||||
.call(document.getElementsByName("left"))
|
||||
.some((c: HTMLInputElement) => c.checked);
|
||||
var right_checked = Array.prototype.slice
|
||||
.call(document.getElementsByName("right"))
|
||||
.some((c: HTMLInputElement) => c.checked);
|
||||
if (left_checked && right_checked) {
|
||||
(document.getElementById("jspsych-maxdiff-next") as HTMLInputElement).disabled =
|
||||
false;
|
||||
|
Loading…
Reference in New Issue
Block a user