generalized addBlockCodeExample with position and return element

chemistry_example
Fabien Benetou 2 years ago
parent 1030436f74
commit 5ce4daa61e
  1. 14
      index.html

@ -2091,14 +2091,16 @@ function addCompoundPrimitiveExample(position="0 1.4 -0.2"){
return el return el
} }
function addBlockCodeExample(text="hi"){ function addBlockCodeExample(text="hi", pos="0 1.4 -0.2"){
el = addNewNote( text ) let el = addNewNote( text )
el.setAttribute("color", "black") el.setAttribute("color", "black")
el.setAttribute("outline-color", "white") el.setAttribute("outline-color", "white")
a = generateCompoundPrimitiveExample() el.setAttribute("position", pos)
el.appendChild(a) let compountPrim = generateCompoundPrimitiveExample()
a.setAttribute("position", "0.1 0 -0.051") compountPrim.setAttribute("position", "0.1 0 -0.051")
el.setAttribute("position", "0 1.4 -0.2"); el.appendChild(compountPrim)
// el.setAttribute('snap-on-pinchended', true)
return el
} }
function generateCompoundPrimitiveExample(position="0 1.4 -0.2"){ function generateCompoundPrimitiveExample(position="0 1.4 -0.2"){

Loading…
Cancel
Save