diff --git a/src/editor/js/components/historynavigator.tsx b/src/editor/js/components/historynavigator.tsx index 4d583fcd8825c48ff325fc0cd450730941fab894..4eb3616831e1551a5689fc3f1f294c52835eb31a 100644 --- a/src/editor/js/components/historynavigator.tsx +++ b/src/editor/js/components/historynavigator.tsx @@ -65,6 +65,11 @@ export class HistoryNavigator extends React.Component<propTypes> { <option key={savepoint.id} value={savepoint.id} + selected={ + savepoint.id === + this.props.historyObject + .currentSavePoint.id + } > {savepoint.description} </option> diff --git a/src/editor/js/structures/manageddata.ts b/src/editor/js/structures/manageddata.ts index c40ada5ad1a18719e4a0365901b88fcdf04cd458..5585d4232fe15793c6099fa144efba9cd80d75ea 100644 --- a/src/editor/js/structures/manageddata.ts +++ b/src/editor/js/structures/manageddata.ts @@ -34,6 +34,13 @@ export default class ManagedData extends SerializableItem { this.storeCurrentData("Initial state", false); } + /** + * @returns SavePoint of current history position. Gives access to meta data of current data. + */ + public get currentSavePoint(): SavePoint { + return this.history[this.historyPosition]; + } + /** * If the data has unsaved changes, this will subscribe to the tab-closing event to warn about losing unsaved changes before closing. * @private @@ -144,7 +151,7 @@ export default class ManagedData extends SerializableItem { return this.setHistoryPosition(i); } } - return false; // Not found + return false; // Not found } /**