diff options
author | bob <bcz@cs.brown.edu> | 2019-05-21 12:35:38 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-05-21 12:35:38 -0400 |
commit | a8717e39df75cbd1fd13435ee9028f230a833399 (patch) | |
tree | a17bf828e79e0f20ceb55546915d0bf4be41928e /src/new_fields/CursorField.ts | |
parent | 7bafa21e8c37826686a012151674b71631fa9c8b (diff) | |
parent | cfb7fdb1a7b2db263502677e57ee882a6fe23f13 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/new_fields/CursorField.ts')
-rw-r--r-- | src/new_fields/CursorField.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/new_fields/CursorField.ts b/src/new_fields/CursorField.ts index 1be1ec3e0..fd86031a8 100644 --- a/src/new_fields/CursorField.ts +++ b/src/new_fields/CursorField.ts @@ -1,7 +1,7 @@ import { ObjectField } from "./ObjectField"; import { observable } from "mobx"; import { Deserializable } from "../client/util/SerializationHelper"; -import { serializable, createSimpleSchema, object } from "serializr"; +import { serializable, createSimpleSchema, object, date } from "serializr"; import { OnUpdate, ToScriptString, Copy } from "./FieldSymbols"; export type CursorPosition = { @@ -11,7 +11,8 @@ export type CursorPosition = { export type CursorMetadata = { id: string, - identifier: string + identifier: string, + timestamp: number }; export type CursorData = { @@ -26,7 +27,8 @@ const PositionSchema = createSimpleSchema({ const MetadataSchema = createSimpleSchema({ id: true, - identifier: true + identifier: true, + timestamp: true }); const CursorSchema = createSimpleSchema({ @@ -47,6 +49,7 @@ export default class CursorField extends ObjectField { setPosition(position: CursorPosition) { this.data.position = position; + this.data.metadata.timestamp = Date.now(); this[OnUpdate](); } |