mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Fix bio eddie iframe loading [SCI-6001]
This commit is contained in:
parent
b432b06ab1
commit
451eb97657
1 changed files with 5 additions and 14 deletions
|
@ -15,22 +15,8 @@ var bioEddieEditor = (function() {
|
|||
}
|
||||
}
|
||||
|
||||
function loadBioEddie() {
|
||||
BIO_EDDIE = bioEddieIframe.contentWindow.bioEddieEditor;
|
||||
CHEMAXON = bioEddieIframe.contentWindow.chemaxon;
|
||||
|
||||
if (typeof BIO_EDDIE === 'undefined' || typeof CHEMAXON === 'undefined') {
|
||||
setTimeout(function() {
|
||||
loadBioEddie();
|
||||
}, 2000);
|
||||
} else {
|
||||
importMolecule();
|
||||
}
|
||||
}
|
||||
|
||||
function initIframe() {
|
||||
bioEddieIframe.src = bioEddieIframe.dataset.src;
|
||||
loadBioEddie();
|
||||
}
|
||||
|
||||
function saveMolecule(svg, structure, scheduleForRegistration) {
|
||||
|
@ -103,6 +89,11 @@ var bioEddieEditor = (function() {
|
|||
$(document).on('turbolinks:load', function() {
|
||||
bioEddieIframe = document.getElementById('bioEddieIframe');
|
||||
bioEddieModal = $('#bioEddieModal');
|
||||
bioEddieIframe.onload = function() {
|
||||
BIO_EDDIE = bioEddieIframe.contentWindow.bioEddieEditor;
|
||||
CHEMAXON = bioEddieIframe.contentWindow.chemaxon;
|
||||
importMolecule();
|
||||
};
|
||||
|
||||
bioEddieModal.on('shown.bs.modal', function() {
|
||||
initIframe();
|
||||
|
|
Loading…
Reference in a new issue