Skip to content
Snippets Groups Projects
Commit a3076071 authored by Maximilian Giller's avatar Maximilian Giller :squid:
Browse files

Selecting correct history point when editing

parent 35d6af96
No related branches found
No related tags found
1 merge request!2Implemented editor in the react framework
Pipeline #56615 passed
...@@ -65,6 +65,11 @@ export class HistoryNavigator extends React.Component<propTypes> { ...@@ -65,6 +65,11 @@ export class HistoryNavigator extends React.Component<propTypes> {
<option <option
key={savepoint.id} key={savepoint.id}
value={savepoint.id} value={savepoint.id}
selected={
savepoint.id ===
this.props.historyObject
.currentSavePoint.id
}
> >
{savepoint.description} {savepoint.description}
</option> </option>
......
...@@ -34,6 +34,13 @@ export default class ManagedData extends SerializableItem { ...@@ -34,6 +34,13 @@ export default class ManagedData extends SerializableItem {
this.storeCurrentData("Initial state", false); 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. * If the data has unsaved changes, this will subscribe to the tab-closing event to warn about losing unsaved changes before closing.
* @private * @private
...@@ -144,7 +151,7 @@ export default class ManagedData extends SerializableItem { ...@@ -144,7 +151,7 @@ export default class ManagedData extends SerializableItem {
return this.setHistoryPosition(i); return this.setHistoryPosition(i);
} }
} }
return false; // Not found return false; // Not found
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment