Add ability to load page version in editor service and show in version modal
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
2020-11-02 22:45:17 -06:00
parent b2eb33f6a0
commit cd37ea1df1
4 changed files with 17 additions and 16 deletions

View File

@@ -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>

View File

@@ -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);
}
}