audrey06100 commited on
Commit
e5fb3be
·
1 Parent(s): d3d85e7
Files changed (1) hide show
  1. app.py +10 -10
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(item => {
110
- name = item.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
- item.style.cssText = `position: absolute; left: ${left}%; bottom: ${bottom}%;`;
115
- item.className = "";
116
- item.querySelector(":scope > span").innerText = "";
117
- item.querySelector(":scope > input").style.cssText = `
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(item => {
180
- name = item.querySelector(":scope > input").value;
181
  left = channel_info.inputDict[name].css_position[0];
182
  bottom = channel_info.inputDict[name].css_position[1];
183
- item.style.left = `${left}%`;
184
- item.style.bottom = `${bottom}%`;
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)";