From 987bf47827fcfe2302730451e398e9a6bb89039d Mon Sep 17 00:00:00 2001 From: Alexander Rose <alex.rose@rcsb.org> Date: Fri, 21 Jun 2019 09:29:03 -0700 Subject: [PATCH] save interactivity props in state --- src/mol-plugin/state.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mol-plugin/state.ts b/src/mol-plugin/state.ts index 0afb842b1..9fdcd12b8 100644 --- a/src/mol-plugin/state.ts +++ b/src/mol-plugin/state.ts @@ -16,6 +16,7 @@ import { PluginCommands } from './command'; import { PluginAnimationManager } from './state/animation/manager'; import { ParamDefinition as PD } from '../mol-util/param-definition'; import { UUID } from '../mol-util'; +import { Interactivity } from './util/interactivity'; export { PluginState } class PluginState { @@ -57,6 +58,7 @@ class PluginState { } : void 0, cameraSnapshots: p.cameraSnapshots ? this.cameraSnapshots.getStateSnapshot() : void 0, canvas3d: p.canvas3d ? { props: this.plugin.canvas3d.props } : void 0, + interactivity: p.interactivity ? { props: this.plugin.interactivity.props } : void 0, durationInMs: params && params.durationInMs }; } @@ -69,6 +71,9 @@ class PluginState { if (snapshot.canvas3d) { if (snapshot.canvas3d.props) await PluginCommands.Canvas3D.SetSettings.dispatch(this.plugin, { settings: snapshot.canvas3d.props }); } + if (snapshot.interactivity) { + if (snapshot.interactivity.props) await PluginCommands.Interactivity.SetProps.dispatch(this.plugin, { props: snapshot.interactivity.props }); + } if (snapshot.cameraSnapshots) this.cameraSnapshots.setStateSnapshot(snapshot.cameraSnapshots); if (snapshot.animation) { this.animation.setSnapshot(snapshot.animation); @@ -123,6 +128,7 @@ namespace PluginState { animation: PD.Boolean(true), startAnimation: PD.Boolean(false), canvas3d: PD.Boolean(true), + interactivity: PD.Boolean(true), camera: PD.Boolean(true), // TODO: make camera snapshots same as the StateSnapshots with "child states?" cameraSnapshots: PD.Boolean(false), @@ -151,6 +157,9 @@ namespace PluginState { canvas3d?: { props?: Canvas3DProps }, + interactivity?: { + props?: Interactivity.Props + }, durationInMs?: number } } -- GitLab