Skip to content
Snippets Groups Projects
Commit 6c677f3e authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Merge branch 'marvinjs-reusable' into 'master'

use iframeId as it has as value `marviniframe`

See merge request !3
parents 211614d6 bf1ba363
No related branches found
No related tags found
1 merge request!3use iframeId as it has as value `marviniframe`
Pipeline #9365 passed
...@@ -6,7 +6,7 @@ class MarvinModal { ...@@ -6,7 +6,7 @@ class MarvinModal {
this.textAreaEl = $('#' + textAreaId); this.textAreaEl = $('#' + textAreaId);
this.exportCallback = exportCallback; this.exportCallback = exportCallback;
this.marvinSketcherInstance = null; this.marvinSketcherInstance = null;
MarvinJSUtil.getEditor("marviniframe").then(function(sketcherInstance) { MarvinJSUtil.getEditor(iframeId).then(function(sketcherInstance) {
this.marvinSketcherInstance = sketcherInstance; this.marvinSketcherInstance = sketcherInstance;
this.marvinSketcherInstance.on('molchange', function(){ this.marvinSketcherInstance.on('molchange', function(){
this.exportSmiles(function(smilesString){ this.exportSmiles(function(smilesString){
...@@ -17,8 +17,8 @@ class MarvinModal { ...@@ -17,8 +17,8 @@ class MarvinModal {
this.modalEl.on('shown.bs.modal', function(){ this.modalEl.on('shown.bs.modal', function(){
//NB: this must be setup only once the modal is shown otherwise //NB: this must be setup only once the modal is shown otherwise
// it doesn't work with Firefox (see https://bugzilla.mozilla.org/show_bug.cgi?id=941146) // it doesn't work with Firefox (see https://bugzilla.mozilla.org/show_bug.cgi?id=941146)
var query = $('#marviniframe').attr('data-smiles'); var query = this.iframeEl.attr('data-smiles');
var fingerprint = $('#marviniframe').attr('data-fingerprint'); var fingerprint = this.iframeEl.attr('data-fingerprint');
$("input[name=fingerprint][value=" + fingerprint + "]").attr('checked', 'checked') $("input[name=fingerprint][value=" + fingerprint + "]").attr('checked', 'checked')
this.importSmiles(query); this.importSmiles(query);
this.textAreaEl.val(query); this.textAreaEl.val(query);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment