Add rename page functionality
This commit is contained in:
parent
3101c973eb
commit
3a1accaae1
18 changed files with 201 additions and 63 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue