mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-17 14:19:05 +08:00
Fix marvinjs initialization for local marvinjs setup (#7656)
Co-authored-by: Martin Artnik <martin@scinote.net>
This commit is contained in:
parent
5ff531e9c7
commit
3cb610280d
1 changed files with 4 additions and 2 deletions
|
|
@ -320,14 +320,16 @@ $(document).on('click', '.gene-sequence-edit-button', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
function initMarvinJs() {
|
function initMarvinJs() {
|
||||||
if (typeof (ChemicalizeMarvinJs) === 'undefined') {
|
const isRemote = $('#marvinjs-editor')[0].dataset.marvinjsMode === 'remote';
|
||||||
|
|
||||||
|
if (isRemote && typeof (ChemicalizeMarvinJs) === 'undefined') {
|
||||||
setTimeout(initMarvinJs, 100);
|
setTimeout(initMarvinJs, 100);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MarvinJsEditor = MarvinJsEditorApi();
|
MarvinJsEditor = MarvinJsEditorApi();
|
||||||
if (MarvinJsEditor.enabled()) {
|
if (MarvinJsEditor.enabled()) {
|
||||||
if ($('#marvinjs-editor')[0].dataset.marvinjsMode === 'remote') {
|
if (isRemote) {
|
||||||
ChemicalizeMarvinJs.createEditor('#marvinjs-sketch').then(function(marvin) {
|
ChemicalizeMarvinJs.createEditor('#marvinjs-sketch').then(function(marvin) {
|
||||||
marvin.setDisplaySettings({ toolbars: 'reporting' });
|
marvin.setDisplaySettings({ toolbars: 'reporting' });
|
||||||
marvinJsRemoteEditor = marvin;
|
marvinJsRemoteEditor = marvin;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue