Merge pull request #7120 from artoscinote/ma_SCI_10260

Fix loading of MarvinJS object (when MarvinJS is disabled) [SCI-10260]
This commit is contained in:
Martin Artnik 2024-02-21 11:00:18 +01:00 committed by GitHub
commit 5d2db5fded
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -320,13 +320,16 @@ $(document).on('click', '.gene-sequence-edit-button', function() {
});
function initMarvinJs() {
if (typeof (ChemicalizeMarvinJs) === 'undefined') {
setTimeout(initMarvinJs, 100);
return;
if (!window.MarvinJsEditor) {
MarvinJsEditor = MarvinJsEditorApi();
}
MarvinJsEditor = MarvinJsEditorApi();
if (MarvinJsEditor.enabled()) {
if (typeof (ChemicalizeMarvinJs) === 'undefined') {
setTimeout(initMarvinJs, 100);
return;
}
if ($('#marvinjs-editor')[0].dataset.marvinjsMode === 'remote') {
ChemicalizeMarvinJs.createEditor('#marvinjs-sketch').then(function(marvin) {
marvin.setDisplaySettings({ toolbars: 'reporting' });