Commit 31d1554a authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

putting specific code of marvin js modal into compound_list.js

parent 29058021
$(document).ready(function(){
var marvinModal = new MarvinModal(
"marviniframe",
'modal-marvin',
'smiles-textarea',
'marvinApplyButton',
function (smilesString){
var fingerprint = $('input[name=fingerprint]:checked').val();
modifyUrl('similar_to',fingerprint+':'+smilesString);
}
);
});
\ No newline at end of file
class MarvinModal {
constructor(iframeId, modalId, textAreaId, applyId){
constructor(iframeId, modalId, textAreaId, applyId, exportCallback){
this.iframeEl = $('#' + iframeId);
this.modalEl = $('#' + modalId);
this.applyEl = $('#' + applyId);
......@@ -25,10 +25,7 @@ class MarvinModal {
}.bind(this));
this.applyEl.click(function(){
this.modalEl.modal('hide');
this.exportSmiles(function(smilesString){
var fingerprint = $('input[name=fingerprint]:checked').val();
modifyUrl('similar_to',fingerprint+':'+smilesString);
}.bind(this));
this.exportSmiles(exportCallback.bind(this));
}.bind(this));
this.textAreaEl.on('input', function(){
this.importSmiles(this.textAreaEl.val())
......@@ -49,7 +46,3 @@ class MarvinModal {
}
}
}
$(document).ready(function(){
var marvinModal = new MarvinModal("marviniframe",'modal-marvin', 'smiles-textarea', 'marvinApplyButton');
});
\ No newline at end of file
......@@ -10,6 +10,7 @@
<script src="/static/marvinjs-18/gui/lib/promise-1.0.0.min.js"></script>
<script src="/static/js/ippidb-compoundws.js"></script>
<script src="/static/js/ippidb-marvinjsmodal.js"></script>
<script src="/static/js/compound_list.js"></script>
{% endblock %}
{% block content %}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment