Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Knowledge Space WP Plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alg
Knowledge Space WP Plugin
Commits
a3076071
Commit
a3076071
authored
2 years ago
by
Maximilian Giller
Browse files
Options
Downloads
Patches
Plain Diff
Selecting correct history point when editing
parent
35d6af96
No related branches found
No related tags found
1 merge request
!2
Implemented editor in the react framework
Pipeline
#56615
passed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/editor/js/components/historynavigator.tsx
+5
-0
5 additions, 0 deletions
src/editor/js/components/historynavigator.tsx
src/editor/js/structures/manageddata.ts
+8
-1
8 additions, 1 deletion
src/editor/js/structures/manageddata.ts
with
13 additions
and
1 deletion
src/editor/js/components/historynavigator.tsx
+
5
−
0
View file @
a3076071
...
...
@@ -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
>
...
...
This diff is collapsed.
Click to expand it.
src/editor/js/structures/manageddata.ts
+
8
−
1
View file @
a3076071
...
...
@@ -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
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment