Skip to content
Snippets Groups Projects
Commit 1864d022 authored by Stekelenburg, A.V. (Alexander, Student )'s avatar Stekelenburg, A.V. (Alexander, Student )
Browse files

Improve animations, get rid of number input type because it rounds automatically

parent 3da04fc7
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,11 @@
break;
}
}
for (const body of document.querySelectorAll(".pane-body")) {
if (body.style.height) {
expandHeight(body, 0);
}
}
});
const runButton = document.getElementById("run-button");
......@@ -74,11 +79,25 @@
* @param {HTMLElement} body
* @param {number} amount
*/
function expandHeight(body, amount) {
body.style.height = (body.scrollHeight + amount) + "px";
function expandHeight(body, additional) {
let amount = 0;
for (const child of body.childNodes) {
if(child.scrollHeight) {
amount += child.scrollHeight;
}
}
// body.style.transition = "initial";
// const previousHeight = body.style.height;
// body.style.removeProperty("height");
// const newHeight = (body.scrollHeight + amount) + "px";
// body.style.height = previousHeight;
// body.style.removeProperty("transition");
body.style.height = (amount + additional)+ "px";
body.style.margin = "0.2em 0 0.4em var(--container-paddding)";
if (body.parentElement.parentElement.classList.contains("pane-body")) {
expandHeight(body.parentElement.parentElement, body.scrollHeight + amount);
expandHeight(body.parentElement.parentElement, amount + additional);
}
}
......
......@@ -89,11 +89,6 @@ function getType(type: string) {
case "Boolean": {
return "checkbox";
}
case "Integer":
case "Real":
case "Long": {
return "number";
}
default: {
return "text";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment