Skip to content

Commit b81c8a7

Browse files
committed
Fix couple of bugs in edit mode
1 parent e634fd7 commit b81c8a7

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/BiowcPathwaygraph.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,6 @@ export class BiowcPathwaygraph extends LitElement {
597597
if (this.applicationMode !== 'editing') {
598598
this.applicationMode = 'viewing';
599599
}
600-
this.switchApplicationMode(this.applicationMode);
601600

602601
this.d3Nodes = [];
603602
this.d3Links = [];
@@ -607,6 +606,7 @@ export class BiowcPathwaygraph extends LitElement {
607606
this._getMainDiv().on('mousedown', () => {
608607
this.dispatchEvent(new CustomEvent('pathwayGraphChanged'));
609608
});
609+
this.switchApplicationMode(this.applicationMode);
610610

611611
this._enableZoomingAndPanning();
612612

@@ -5353,6 +5353,16 @@ font-family: "Roboto Light", "Helvetica Neue", "Verdana", sans-serif'><strong st
53535353
// The 'viewing' class has no effect right now, but I'm using it in analogy to the 'editing' class below,
53545354
// which has a CSS style
53555355
this._getMainDiv().attr('class', 'viewing');
5356+
5357+
// If backups exist, apply them
5358+
if (!!this.ptmInputListBackup && this.ptmInputListBackup.length > 0)
5359+
this.ptmInputList = this.ptmInputListBackup;
5360+
if (
5361+
!!this.fullProteomeInputListBackup &&
5362+
this.fullProteomeInputListBackup.length > 0
5363+
)
5364+
this.fullProteomeInputList = this.fullProteomeInputListBackup;
5365+
53565366
// Clear the backups
53575367
this.ptmInputListBackup = [];
53585368
this.fullProteomeInputListBackup = [];
@@ -5369,13 +5379,6 @@ font-family: "Roboto Light", "Helvetica Neue", "Verdana", sans-serif'><strong st
53695379
this._getMainDiv().attr('class', 'editing');
53705380
this.hue = 'direction';
53715381

5372-
/**
5373-
* Note to future self: Maybe need to comment out Lines 1368ff in PTMNavigator:
5374-
* this.graphdataSkeleton = undefined
5375-
* this.selectedCanonicalPathway = undefined
5376-
* this.selectedCustomPathway = undefined
5377-
*/
5378-
53795382
// Keep a backup of the input lists to reapply it later
53805383
this.ptmInputListBackup = this.ptmInputList;
53815384
this.fullProteomeInputListBackup = this.fullProteomeInputList;
@@ -5386,6 +5389,8 @@ font-family: "Roboto Light", "Helvetica Neue", "Verdana", sans-serif'><strong st
53865389
.select<SVGElement>('#pathwayLegend')
53875390
.selectAll('*')
53885391
.remove();
5392+
5393+
if (this.graphdataSkeleton.nodes.length > 0) this._refreshGraph(false);
53895394
}
53905395
}
53915396
}

0 commit comments

Comments
 (0)