Skip to content

Commit

Permalink
Layout: allow navigate-with-project settings in stack viewer layout
Browse files Browse the repository at this point in the history
  • Loading branch information
tomka committed Jul 26, 2023
1 parent 61c6adb commit 220e044
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ Miscellaneous:
- NBLAST computation: avoid crash when set of not cached target DPS objects is
None.

- The navigate-with-project setting of a stack viewer is now respected in
stored layouts.

## Maintenance updates

- Node distance measurements: computation of straight line distance has been
Expand Down
10 changes: 10 additions & 0 deletions django/applications/catmaid/static/js/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@
var stackViewer = stackViewerMapping.get(node);
if (stackViewer) {
let orientation = orientationToKeyword(stackViewer.primaryStack.orientation);
let navigateWithProject = stackViewer.primaryStack.navigateWithProject;
// Check if there are subscriptions on any tracing layer shown in this
// viewer. If so, return an extended version of this stack reference to
// include this information.
Expand All @@ -848,6 +849,10 @@
}
}
}
let extraComponents = [];
if (navigateWithProject) {
extraComponents.push(`, navigateWithProject: ${navigateWithProject ? 'true' : 'false'}`);
}
if (subscriptionComponents.length > 0) {
var components = [`{ type: "stackviewer", orientation: ${orientation}`];
var isSubscriptionSource = subscriptionInfo.idIndex.has(stackViewer);
Expand All @@ -862,8 +867,13 @@
subscriptionInfo.idIndex.get(s.target), '" }');
}
components.push(']');
extraComponents.forEach(e => components.push(e));
components.push(' }');
return components.join('');
} else if (extraComponents.length > 0) {
var components = [`{ type: "stackviewer", orientation: ${orientation}`];
extraComponents.forEach(e => components.push(e));
components.push(' }');
} else {
return orientation;
}
Expand Down

0 comments on commit 220e044

Please sign in to comment.