Skip to content

Commit

Permalink
Removes layout animation option when adding a new pathway, and select…
Browse files Browse the repository at this point in the history
…s the new node.
  • Loading branch information
chrtannus committed Sep 18, 2023
1 parent 5584fe1 commit 00633b6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/client/components/network-editor/search-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const PathwayListPanel = ({ searchTerms, items, controller, onNetworkWillChange,
const nes = p ? p.NES : null;

const applyLayout = async () => {
const layoutOptions = Object.assign(CoSELayoutOptions, { animate: true, animationDuration: 1000, animationEasing: 'ease-out' });
const layoutOptions = Object.assign(CoSELayoutOptions, { animationDuration: 1000, animationEasing: 'ease-out' });
const layout = cy.layout(layoutOptions);
const onStop = layout.promiseOn('layoutstop');
layout.run();
Expand All @@ -233,7 +233,7 @@ const PathwayListPanel = ({ searchTerms, items, controller, onNetworkWillChange,
// Start -- notify
onNetworkWillChange();
// Add node
cy.add({
const newNode = cy.add({
group: 'nodes',
data: {
'name': [ p.name.toUpperCase() + '%' ], // TODO set the actual name with DB_SOURCE, etc.
Expand All @@ -249,6 +249,9 @@ const PathwayListPanel = ({ searchTerms, items, controller, onNetworkWillChange,
});
// Apply layout again
await applyLayout();
// Select the new node
cy.elements().unselect();
newNode.select();
// End -- notify
onNetworkChanged();
};
Expand Down

0 comments on commit 00633b6

Please sign in to comment.