summaryrefslogtreecommitdiff
path: root/app/static
diff options
context:
space:
mode:
Diffstat (limited to 'app/static')
-rw-r--r--app/static/js/create.js26
1 files changed, 10 insertions, 16 deletions
diff --git a/app/static/js/create.js b/app/static/js/create.js
index 0f63956..a9bf7ae 100644
--- a/app/static/js/create.js
+++ b/app/static/js/create.js
@@ -32,22 +32,16 @@ function handleDel(elem) {
}
}
-document.getElementById("add").onclick = handleAdd;
-
function handleChange(elem) {
- if (elem.target.value == 'time') {
- elem.target.parentNode.parentNode.parentNode.children[1].placeholder = "Time (in seconds)";
- elem.target.parentNode.parentNode.parentNode.children[1].selected = true;
- elem.target.parentNode.parentNode.children[1].children[0].classList.remove('fa-calculator');
- elem.target.parentNode.parentNode.children[1].children[0].classList.add('fa-clock-o');
- } else if (elem.target.value == 'reps') {
- elem.target.parentNode.parentNode.children[1].children[0].classList.add('fa-calculator');
- elem.target.parentNode.parentNode.children[1].children[0].classList.remove('fa-clock-o');
- elem.target.parentNode.parentNode.parentNode.children[1].selected = true;
- elem.target.parentNode.parentNode.parentNode.children[1].placeholder = "Reps";
+ if (elem.value == 'time') {
+ elem.parentNode.parentNode.parentNode.children[1].placeholder = "Time (in seconds)";
+ elem.parentNode.parentNode.parentNode.children[1].selected = true;
+ elem.parentNode.parentNode.children[1].children[0].classList.remove('fa-calculator');
+ elem.parentNode.parentNode.children[1].children[0].classList.add('fa-clock-o');
+ } else if (elem.value == 'reps') {
+ elem.parentNode.parentNode.children[1].children[0].classList.add('fa-calculator');
+ elem.parentNode.parentNode.children[1].children[0].classList.remove('fa-clock-o');
+ elem.parentNode.parentNode.parentNode.children[1].selected = true;
+ elem.parentNode.parentNode.parentNode.children[1].placeholder = "Reps";
}
}
-
-for (row of rowsDiv.children) {
- row.children[0].children[2].children[0].children[0].children[0].addEventListener('input', handleChange);
-}