Skip to content

Commit

Permalink
fixing loading bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NikoAnderson committed Apr 1, 2024
1 parent ab386fa commit e776cc5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions projects/jsdraw-wrapper/src/lib/jsdraw-wrapper.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { JSDraw } from './jsdraw.model';

@Component({
selector: 'ncats-jsdraw-wrapper',
template: `<div id="randomId" class="jsdrawRandom" dataformat="molfile" style="width:968px"></div>`,
styles: ['::ng-deep .jsdrawRandom { width:968px !important}; ']
template: `<div [id]="randomId" dataformat="molfile" ></div>`,
styles: []
})
export class JsdrawWrapperComponent implements AfterViewInit {
randomId: string;
Expand Down
1 change: 0 additions & 1 deletion src/app/core/assets/jsdraw/JSDraw.extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 3 additions & 5 deletions src/app/core/structure-editor/structure-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
Expand All @@ -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);
}

}

Expand Down

0 comments on commit e776cc5

Please sign in to comment.