mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-14 09:04:56 +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() {
|
||||
if (typeof (ChemicalizeMarvinJs) === 'undefined') {
|
||||
const isRemote = $('#marvinjs-editor')[0].dataset.marvinjsMode === 'remote';
|
||||
|
||||
if (isRemote && typeof (ChemicalizeMarvinJs) === 'undefined') {
|
||||
setTimeout(initMarvinJs, 100);
|
||||
return;
|
||||
}
|
||||
|
||||
MarvinJsEditor = MarvinJsEditorApi();
|
||||
if (MarvinJsEditor.enabled()) {
|
||||
if ($('#marvinjs-editor')[0].dataset.marvinjsMode === 'remote') {
|
||||
if (isRemote) {
|
||||
ChemicalizeMarvinJs.createEditor('#marvinjs-sketch').then(function(marvin) {
|
||||
marvin.setDisplaySettings({ toolbars: 'reporting' });
|
||||
marvinJsRemoteEditor = marvin;
|
||||
|
|
Loading…
Add table
Reference in a new issue