Add ability to load page version in editor service and show in version modal
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
<div class="preview">
|
||||
<app-editor [pageId]="pageId" *ngIf="selectedVersion" [hosted]="true" [readonly]="true" #editor></app-editor>
|
||||
<app-editor [pageId]="pageId" *ngIf="selectedVersion" [hosted]="true" [readonly]="true" [version]="selectedVersion.versionNum" #editor></app-editor>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -26,10 +26,7 @@ export class VersionModalComponent implements OnInit {
|
||||
|
||||
async ngOnInit() {
|
||||
this.pageVersions = await this.editorService.loadPageVersions(this.pageId);
|
||||
this.selectedVersion = this.pageVersions[0];
|
||||
setTimeout(() => {
|
||||
this.onVersionClick(this.pageVersions[0]);
|
||||
}, 100);
|
||||
this.onVersionClick(this.pageVersions[0]);
|
||||
}
|
||||
|
||||
dismiss() {
|
||||
@@ -38,8 +35,10 @@ export class VersionModalComponent implements OnInit {
|
||||
|
||||
async onVersionClick(version: PageVersionRecord) {
|
||||
this.selectedVersion = version;
|
||||
if ( this.editor ) {
|
||||
this.editor.ionViewDidEnter();
|
||||
}
|
||||
setTimeout(() => {
|
||||
if ( this.editor ) {
|
||||
this.editor.ionViewDidEnter();
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user