Display page number, title, and description in wizard page headers (#1766)

This commit is contained in:
Matt Irvine
2018-06-27 16:26:26 -07:00
committed by GitHub
parent ffe27f5bde
commit 5cf85a0361
14 changed files with 119 additions and 29 deletions

View File

@@ -133,18 +133,28 @@ export class WizardModal extends Modal {
});
this._wizard.onPageAdded(page => {
this.registerPage(page);
this.updatePageNumbers();
this.showPage(this._wizard.currentPage, false);
});
this._wizard.onPageRemoved(page => {
let dialogPane = this._dialogPanes.get(page);
this._dialogPanes.delete(page);
this.updatePageNumbers();
this.showPage(this._wizard.currentPage, false);
dialogPane.dispose();
});
this.updatePageNumbers();
}
private updatePageNumbers(): void {
this._wizard.pages.forEach((page, index) => {
let dialogPane = this._dialogPanes.get(page);
dialogPane.pageNumber = index + 1;
});
}
private registerPage(page: WizardPage): void {
let dialogPane = new DialogPane(page.title, page.content, valid => page.notifyValidityChanged(valid), this._instantiationService);
let dialogPane = new DialogPane(page.title, page.content, valid => page.notifyValidityChanged(valid), this._instantiationService, this._wizard.displayPageTitles, page.description);
dialogPane.createBody(this._body);
this._dialogPanes.set(page, dialogPane);
page.onUpdate(() => this.setButtonsForPage(this._wizard.currentPage));