Add rename page functionality

This commit is contained in:
Andras Schmelczer 2019-09-08 16:10:33 +02:00
parent 3101c973eb
commit 3a1accaae1
18 changed files with 201 additions and 63 deletions

View file

@ -51,6 +51,16 @@ export class PagesComponent implements OnInit {
});
}
changeName({ from, to }: { from: string; to: string }) {
const page = this.pages.find(p => p.name === from);
if (page) {
page.changeName(to);
if (from === this.selectedPageName) {
this.selectPage(to);
}
}
}
selectPage(name: string) {
if (!name) {
if (this.pages && this.pages.length > 0) {