Skip to content

Commit

Permalink
Remove event listener that drew cue
Browse files Browse the repository at this point in the history
-After correcting the delay on 'afterexpand' and 'aftercollapse' events I realized a problem that was being masked by the incorrect delay. This commit seems to fix it, as the 'select unselect' event listener does the job of drawing and clearing the visual cue just fine.

- This commit may be problematic or cause side effects, but doesn't seem to currently be a problem. Can be safely reverted back if that is the case, but that will still leave a problem to be fixed, that is, when animations are disabled, the cue is drawn on the screen too fast and is redrawn at the end of the animation by the 'select unselect' listener anyways.
  • Loading branch information
msalihaltun committed Sep 30, 2020
1 parent 31de0cc commit 9ad46ef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
13 changes: 1 addition & 12 deletions cytoscape-expand-collapse.js

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions src/cueUtilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,6 @@ module.exports = function (params, cy, api) {

cy.on('pan zoom', data.ePosition);

cy.on('expandcollapse.afterexpand expandcollapse.aftercollapse', 'node', data.eAfterExpandCollapse = function () {
var delay = 50 + (params.animate ? params.animationDuration : 0);
setTimeout(() => {
if (this.selected()) {
drawExpandCollapseCue(this);
}
}, delay);
});

// write options to data
data.hasEventFields = true;
setData(data);
Expand All @@ -318,7 +309,6 @@ module.exports = function (params, cy, api) {
.off('position', 'node', data.ePosition)
.off('pan zoom', data.ePosition)
.off('select unselect', data.eSelect)
.off('expandcollapse.afterexpand expandcollapse.aftercollapse', 'node', data.eAfterExpandCollapse)
.off('free', 'node', data.eFree)
.off('resize', data.eCyResize);
},
Expand All @@ -338,7 +328,6 @@ module.exports = function (params, cy, api) {
.on('position', 'node', data.ePosition)
.on('pan zoom', data.ePosition)
.on('select unselect', data.eSelect)
.on('expandcollapse.afterexpand expandcollapse.aftercollapse', 'node', data.eAfterExpandCollapse)
.on('free', 'node', data.eFree)
.on('resize', data.eCyResize);
}
Expand Down

0 comments on commit 9ad46ef

Please sign in to comment.