Spaces:
Sleeping
Sleeping
Commit
·
e5fb3be
1
Parent(s):
d3d85e7
update
Browse files
app.py
CHANGED
@@ -106,15 +106,15 @@ init_js = """
|
|
106 |
// move the radios/checkboxes
|
107 |
let name, left, bottom;
|
108 |
const elements = div.querySelectorAll(":scope > label");
|
109 |
-
Array.from(elements).forEach(
|
110 |
-
name =
|
111 |
left = channel_info.inputDict[name].css_position[0];
|
112 |
bottom = channel_info.inputDict[name].css_position[1];
|
113 |
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
position: absolute;
|
119 |
width: var(--channel-indicator-size);
|
120 |
height: var(--channel-indicator-size);
|
@@ -176,12 +176,12 @@ update_js = """
|
|
176 |
|
177 |
// update the radios
|
178 |
const elements = document.querySelectorAll(selector+" > label");
|
179 |
-
Array.from(elements).forEach(
|
180 |
-
name =
|
181 |
left = channel_info.inputDict[name].css_position[0];
|
182 |
bottom = channel_info.inputDict[name].css_position[1];
|
183 |
-
|
184 |
-
|
185 |
});
|
186 |
}else if(stage1_info.state == "step3-2-selecting"){
|
187 |
selector = "#chkbox-group > div:nth-of-type(2)";
|
|
|
106 |
// move the radios/checkboxes
|
107 |
let name, left, bottom;
|
108 |
const elements = div.querySelectorAll(":scope > label");
|
109 |
+
Array.from(elements).forEach( el => {
|
110 |
+
name = el.querySelector(":scope > input").getAttribute(attribute);
|
111 |
left = channel_info.inputDict[name].css_position[0];
|
112 |
bottom = channel_info.inputDict[name].css_position[1];
|
113 |
|
114 |
+
el.style.cssText = `position: absolute; left: ${left}%; bottom: ${bottom}%;`;
|
115 |
+
el.className = "";
|
116 |
+
el.querySelector(":scope > span").innerText = "";
|
117 |
+
el.querySelector(":scope > input").style.cssText = `
|
118 |
position: absolute;
|
119 |
width: var(--channel-indicator-size);
|
120 |
height: var(--channel-indicator-size);
|
|
|
176 |
|
177 |
// update the radios
|
178 |
const elements = document.querySelectorAll(selector+" > label");
|
179 |
+
Array.from(elements).forEach( el => {
|
180 |
+
name = el.querySelector(":scope > input").value;
|
181 |
left = channel_info.inputDict[name].css_position[0];
|
182 |
bottom = channel_info.inputDict[name].css_position[1];
|
183 |
+
el.style.left = `${left}%`;
|
184 |
+
el.style.bottom = `${bottom}%`;
|
185 |
});
|
186 |
}else if(stage1_info.state == "step3-2-selecting"){
|
187 |
selector = "#chkbox-group > div:nth-of-type(2)";
|