Constructor
new VersionHistoryDialog(projectId, accessLevel, server, callbacks)
Parameters:| Name | Type | Description |
|---|
projectId | string | ID of the project whose versions are displayed. |
accessLevel | string | 'viewer' | 'editor' | 'owner' |
server | object | Server instance |
callbacks | object | Callback functions for version actions.Properties| Name | Type | Attributes | Description |
|---|
onRevertCurrent | function | | Called with the full version object to revert in place | onOpenAsNew | function | | Called with the full version object to open as a new project | onSaveVersion | function | <optional>
| Called with label string to save a named version; if omitted the Save button is hidden |
|
Classes
- VersionHistoryDialog
Methods
_buildDOM()
Builds and attaches the dialog's DOM structure.
_buildVersionRow(v) → {HTMLElement}
Parameters:| Name | Type | Description |
|---|
v | object | Version index entry to render as a list row. |
Returns:The constructed row element.
- Type:
- HTMLElement
(async) _deleteVersion(versionId, row)
Parameters:| Name | Type | Description |
|---|
versionId | string | ID of the version to delete. |
row | HTMLElement | Row element to remove on success. |
(async) _load()
Fetches the version list from the server and renders it.
(async) _openAsNew(versionId, btn)
Parameters:| Name | Type | Description |
|---|
versionId | string | ID of the version to open. |
btn | HTMLButtonElement | Button element to show loading state on. |
_openSaveVersionUI()
Shows the inline save-version form and wires up its confirm/cancel handlers.
_renderList(versions)
Parameters:| Name | Type | Description |
|---|
versions | Array.<object> | Array of version index entries to render. |
(async) _revertCurrent(versionId, btn)
Parameters:| Name | Type | Description |
|---|
versionId | string | ID of the version to revert to. |
btn | HTMLButtonElement | Button element to show loading state on. |
close()
Removes the dialog and backdrop from the DOM.