diff --git a/ippisite/ippidb/static/js/compound_form.js b/ippisite/ippidb/static/js/compound_form.js index a62cf3da6aaeda7f8432211b972e48251541c2f4..e5b3896e78d3ae04b712dbff3608c675de9d75a5 100644 --- a/ippisite/ippidb/static/js/compound_form.js +++ b/ippisite/ippidb/static/js/compound_form.js @@ -91,17 +91,3 @@ function showCanvas(Compound){ y.style.display = "flex"; } }; - -function showCanvas_onload(Compound){ - var z = Compound.value; - var x = document.getElementById('canvas_window-'.concat(Compound.name)); - var y = document.getElementById('canvas_placeholder-'.concat(Compound.name)); - console.log("test onload",Compound); - if (z!="") { - x.style.display = "flex"; - y.style.display = "none"; - } else { - x.style.display = "none"; - y.style.display = "flex"; - } -}; \ No newline at end of file diff --git a/ippisite/ippidb/templates/compound_form_content.html b/ippisite/ippidb/templates/compound_form_content.html index 7b11c806f51393394071e1a3fe9e6abb28078115..ee750a8f401964e8ecd1e37c98f27e1b63522058 100644 --- a/ippisite/ippidb/templates/compound_form_content.html +++ b/ippisite/ippidb/templates/compound_form_content.html @@ -61,6 +61,11 @@ src="/static/images/Other/SMILESIcon.png" width="35" height="35" /> <p style="margin:5px;">Paste SMILE code</p> </a> + <script type="text/javascript"> + $(document).ready(function () { + showCanvas(document.getElementById('{{form.molecule_smiles.id_for_label}}')); + }); + </script> <div class="molecule_code_button" onclick="showModalFromMe(this);return false;"> <a><i class="fas fa-pencil-alt fa-2x"></i> <p style="margin:5px;">Sketch your compound</p>