freealise commited on
Commit
9b45ad8
1 Parent(s): e3dd182

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -6
app.py CHANGED
@@ -648,12 +648,24 @@ async(c, o, b, p, d, n, m)=>{
648
  document.getElementById("iframe3D").contentDocument.getElementById("coords").value = c;
649
  document.getElementById("iframe3D").contentDocument.getElementById("order").value = o;
650
  document.getElementById("iframe3D").contentDocument.getElementById("bgcolor").value = b;
651
- if (document.getElementById("iframe3D").contentDocument.getElementById("bgimage").value.slice(-1) != ",") {
652
- document.getElementById("iframe3D").contentDocument.getElementById("bgimage").value = p[n].image.url + ",";
653
- document.getElementById("iframe3D").contentDocument.getElementById("bgdepth").value = d.background.url + ",";
654
- } else {
655
- document.getElementById("iframe3D").contentDocument.getElementById("bgimage").value += p[n].image.url + ",";
656
- document.getElementById("iframe3D").contentDocument.getElementById("bgdepth").value += d.background.url + ",";
 
 
 
 
 
 
 
 
 
 
 
 
657
  }
658
  }
659
  toggleDisplay("model");
 
648
  document.getElementById("iframe3D").contentDocument.getElementById("coords").value = c;
649
  document.getElementById("iframe3D").contentDocument.getElementById("order").value = o;
650
  document.getElementById("iframe3D").contentDocument.getElementById("bgcolor").value = b;
651
+
652
+ if (o.indexOf(""+n) < 0) {
653
+ if (o != "") { o += ","; }
654
+ o += n;
655
+ }
656
+ alert(o);
657
+ var o_ = o.split(",");
658
+ document.getElementById("iframe3D").contentDocument.getElementById("bgimage").value = "";
659
+ document.getElementById("iframe3D").contentDocument.getElementById("bgdepth").value = "";
660
+ for (var j=0; j<o_.length; j++) {
661
+ o_[j] = parseInt(o_[j]);
662
+ alert(o_[j]);
663
+ document.getElementById("iframe3D").contentDocument.getElementById("bgimage").value += p[o_[j]].image.url + ",";
664
+ if (o_[j] == n) {
665
+ document.getElementById("iframe3D").contentDocument.getElementById("bgdepth").value += d.background.url + ",";
666
+ } else {
667
+ document.getElementById("iframe3D").contentDocument.getElementById("bgdepth").value += m[o_[j]].url + ",";
668
+ }
669
  }
670
  }
671
  toggleDisplay("model");