From e776cc56a3b7e3fa3e3fb2fbccd7daa53a88aa6c Mon Sep 17 00:00:00 2001 From: NikoAnderson Date: Mon, 1 Apr 2024 15:58:19 -0400 Subject: [PATCH] fixing loading bug --- .../jsdraw-wrapper/src/lib/jsdraw-wrapper.component.ts | 4 ++-- src/app/core/assets/jsdraw/JSDraw.extensions.js | 1 - .../core/structure-editor/structure-editor.component.ts | 8 +++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/projects/jsdraw-wrapper/src/lib/jsdraw-wrapper.component.ts b/projects/jsdraw-wrapper/src/lib/jsdraw-wrapper.component.ts index 6040948a0..5679c7709 100644 --- a/projects/jsdraw-wrapper/src/lib/jsdraw-wrapper.component.ts +++ b/projects/jsdraw-wrapper/src/lib/jsdraw-wrapper.component.ts @@ -4,8 +4,8 @@ import { JSDraw } from './jsdraw.model'; @Component({ selector: 'ncats-jsdraw-wrapper', - template: `
`, - styles: ['::ng-deep .jsdrawRandom { width:968px !important}; '] + template: `
`, + styles: [] }) export class JsdrawWrapperComponent implements AfterViewInit { randomId: string; diff --git a/src/app/core/assets/jsdraw/JSDraw.extensions.js b/src/app/core/assets/jsdraw/JSDraw.extensions.js index 1135c2e6b..b390f1bb1 100644 --- a/src/app/core/assets/jsdraw/JSDraw.extensions.js +++ b/src/app/core/assets/jsdraw/JSDraw.extensions.js @@ -912,7 +912,6 @@ var callback = function(){ // Note that this is still an issue if there is more than one editor being used at one // time. JSDraw will need to fix. JSDraw2.Editor.atomlistDlg=null; - JSDraw2.Editor.width=960; // This prevents the context menu from spawning more events on right-click events (function() { diff --git a/src/app/core/structure-editor/structure-editor.component.ts b/src/app/core/structure-editor/structure-editor.component.ts index 9c749e87d..65c4b9bce 100644 --- a/src/app/core/structure-editor/structure-editor.component.ts +++ b/src/app/core/structure-editor/structure-editor.component.ts @@ -174,8 +174,8 @@ export class StructureEditorComponent implements OnInit, AfterViewInit, OnDestro this.ketcher = ketcher; if (this.structureEditor === 'ketcher'){ - this.editor = new EditorImplementation(this.ketcher); - this.editorOnLoad.emit(this.editor); + // this.editor = new EditorImplementation(this.ketcher); + // this.editorOnLoad.emit(this.editor); } }, 1000); @@ -190,7 +190,7 @@ export class StructureEditorComponent implements OnInit, AfterViewInit, OnDestro this.editorOnLoad.emit(this.editor); } else { this.structureEditor = 'ketcher'; - this.editor = new EditorImplementation(this.ketcher, null); + this.editor = new EditorImplementation(this.ketcher); this.editorOnLoad.emit(this.editor); console.log(this.jsdraw.options); } @@ -199,10 +199,8 @@ export class StructureEditorComponent implements OnInit, AfterViewInit, OnDestro jsDrawOnLoad(jsdraw: JSDraw): void { console.log('loaded'); this.jsdraw = jsdraw; - if (this.structureEditor === 'jsdraw'){ this.editor = new EditorImplementation(null, this.jsdraw); this.editorOnLoad.emit(this.editor); - } }