From 572c964935bc124d12f9517622f91bb9d7b5f9f7 Mon Sep 17 00:00:00 2001 From: Rachel TORCHET <racheltorchet@users.noreply.github.com> Date: Wed, 10 Jun 2020 15:43:31 +0200 Subject: [PATCH] CompoundForm - Fix placeholder empty compound (FIX #137) --- ippisite/ippidb/static/js/compound_form.js | 14 -------------- .../ippidb/templates/compound_form_content.html | 5 +++++ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/ippisite/ippidb/static/js/compound_form.js b/ippisite/ippidb/static/js/compound_form.js index a62cf3da..e5b3896e 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 7b11c806..ee750a8f 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> -- GitLab