From 220e0443569be4b5ebacfda568f33228a15e1a78 Mon Sep 17 00:00:00 2001 From: Tom Kazimiers Date: Wed, 26 Jul 2023 15:02:45 +0200 Subject: [PATCH] Layout: allow navigate-with-project settings in stack viewer layout --- CHANGELOG.md | 3 +++ django/applications/catmaid/static/js/layout.js | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32670496e5..005eefa310 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/django/applications/catmaid/static/js/layout.js b/django/applications/catmaid/static/js/layout.js index 47b4f8c9cc..48d7a221df 100644 --- a/django/applications/catmaid/static/js/layout.js +++ b/django/applications/catmaid/static/js/layout.js @@ -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. @@ -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); @@ -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; }