jbrowse-plugin-protein3d 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LaunchProteinView/utils/sideBySide.js +9 -6
- package/dist/jbrowse-plugin-protein3d.esm.js +7 -7
- package/dist/jbrowse-plugin-protein3d.esm.js.map +3 -3
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/LaunchProteinView/utils/sideBySide.test.ts +14 -0
- package/src/LaunchProteinView/utils/sideBySide.ts +19 -9
- package/src/version.ts +1 -1
|
@@ -15,6 +15,9 @@ export function setLaunchSideBySide(value) {
|
|
|
15
15
|
}
|
|
16
16
|
const hasAction = (session, name) => name in session &&
|
|
17
17
|
typeof session[name] === 'function';
|
|
18
|
+
function isSessionWithMoves(session) {
|
|
19
|
+
return hasAction(session, 'moveViewToSplit');
|
|
20
|
+
}
|
|
18
21
|
// Warned at most once: this is a property of the host, so it is the same answer
|
|
19
22
|
// every launch, and a dialog the user reopens should not stack up console noise.
|
|
20
23
|
let warnedPartial = false;
|
|
@@ -35,14 +38,14 @@ function isSessionWithWorkspaces(session) {
|
|
|
35
38
|
return canEnable && canPlace;
|
|
36
39
|
}
|
|
37
40
|
/**
|
|
38
|
-
* Place a freshly-added view to the right of
|
|
39
|
-
*
|
|
40
|
-
* pending move for this view, then enable workspaces so TiledViewsContainer
|
|
41
|
-
* consumes the move on mount (other views land in the left panel, this one in a
|
|
42
|
-
* new right panel). No-op on sessions without workspaces support.
|
|
41
|
+
* Place a freshly-added view in a cell to the right of its own, the View menu's
|
|
42
|
+
* "Move to split view (right)". No-op on sessions without a workspace.
|
|
43
43
|
*/
|
|
44
44
|
export function launchViewSideBySide(session, viewId) {
|
|
45
|
-
if (
|
|
45
|
+
if (isSessionWithMoves(session)) {
|
|
46
|
+
session.moveViewToSplit(viewId, 'row');
|
|
47
|
+
}
|
|
48
|
+
else if (isSessionWithWorkspaces(session)) {
|
|
46
49
|
session.setPendingMove({ type: 'splitRight', viewId });
|
|
47
50
|
session.setUseWorkspaces(true);
|
|
48
51
|
}
|