forked from projects/fipamo
31 lines
649 B
JavaScript
31 lines
649 B
JavaScript
|
import PageEditor from "./PageEditor";
|
||
|
export default class PostIndex {
|
||
|
//--------------------------
|
||
|
// constructor
|
||
|
//--------------------------
|
||
|
constructor(page) {
|
||
|
this.currentPage = null;
|
||
|
this.choosePage(page);
|
||
|
this.start();
|
||
|
}
|
||
|
//--------------------------
|
||
|
// methods
|
||
|
//--------------------------
|
||
|
start() {}
|
||
|
choosePage(page) {
|
||
|
this.currentPage = "";
|
||
|
switch (page) {
|
||
|
case "edit":
|
||
|
case "add":
|
||
|
this.currentPage = new PageEditor();
|
||
|
break;
|
||
|
default:
|
||
|
//just chill
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
//--------------------------
|
||
|
// event handlers
|
||
|
//--------------------------
|
||
|
}
|