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