mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-28 16:08:22 +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() {
|
function initIframe() {
|
||||||
bioEddieIframe.src = bioEddieIframe.dataset.src;
|
bioEddieIframe.src = bioEddieIframe.dataset.src;
|
||||||
loadBioEddie();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveMolecule(svg, structure, scheduleForRegistration) {
|
function saveMolecule(svg, structure, scheduleForRegistration) {
|
||||||
|
@ -103,6 +89,11 @@ var bioEddieEditor = (function() {
|
||||||
$(document).on('turbolinks:load', function() {
|
$(document).on('turbolinks:load', function() {
|
||||||
bioEddieIframe = document.getElementById('bioEddieIframe');
|
bioEddieIframe = document.getElementById('bioEddieIframe');
|
||||||
bioEddieModal = $('#bioEddieModal');
|
bioEddieModal = $('#bioEddieModal');
|
||||||
|
bioEddieIframe.onload = function() {
|
||||||
|
BIO_EDDIE = bioEddieIframe.contentWindow.bioEddieEditor;
|
||||||
|
CHEMAXON = bioEddieIframe.contentWindow.chemaxon;
|
||||||
|
importMolecule();
|
||||||
|
};
|
||||||
|
|
||||||
bioEddieModal.on('shown.bs.modal', function() {
|
bioEddieModal.on('shown.bs.modal', function() {
|
||||||
initIframe();
|
initIframe();
|
||||||
|
|
Loading…
Add table
Reference in a new issue