Skip to content

Commit

Permalink
Remove selector filtering
Browse files Browse the repository at this point in the history
This code did not seem to have any effect, at least vs vanilla Hypha.
  • Loading branch information
bickelj committed Sep 26, 2024
1 parent e1d6912 commit c38f612
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions hypha/static_src/javascript/review-form-score.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,21 @@
"use strict";

// grab all the selectors
let filtered_selectors;
const selectors = Array.prototype.slice.call(
document.querySelectorAll("select")
);

if (selectors.length > 1) {
document.querySelector(".form--score-box").style.display = "block";

// remove recommendation select box from array
filtered_selectors = selectors.filter(
(selector) => selector[0].text !== "Need More Info"
);
calculate_score();

filtered_selectors.forEach((selector) => {
selectors.forEach((selector) => {
selector.addEventListener("change", calculate_score);
});
}

function calculate_score() {
let score = 0;
filtered_selectors.forEach((selector) => {
selectors.forEach((selector) => {
const value = parseInt(selector.value);

if (!isNaN(value) && value !== 99) {
Expand Down

0 comments on commit c38f612

Please sign in to comment.