mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 06:35:56 +08:00
Fix marvinjs initialization for local marvinjs setup
This commit is contained in:
parent
5ff531e9c7
commit
cc115f0be8
|
@ -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…
Reference in a new issue