2018-11-20 19:42:52 -05:00
|
|
|
import PostIndex from './PostIndex';
|
2018-12-19 12:56:18 -05:00
|
|
|
import SettingsIndex from './SettingsIndex';
|
2019-01-12 14:07:08 -05:00
|
|
|
import NaviIndex from './NavIndex';
|
2018-11-20 19:42:52 -05:00
|
|
|
|
|
|
|
export default class DashManager {
|
2019-02-27 11:17:51 -05:00
|
|
|
//--------------------------
|
|
|
|
// constructor
|
|
|
|
//--------------------------
|
|
|
|
constructor() {
|
|
|
|
this.currentDisplay = '';
|
|
|
|
this.urlPieces = document.URL.split('/');
|
|
|
|
this.chooseDisplay(this.urlPieces[5], this.urlPieces[6]);
|
|
|
|
}
|
|
|
|
//--------------------------
|
|
|
|
// methods
|
|
|
|
//--------------------------
|
|
|
|
start() {}
|
2018-11-20 19:42:52 -05:00
|
|
|
|
2019-02-27 11:17:51 -05:00
|
|
|
chooseDisplay(section, page) {
|
|
|
|
this.currentDisplay = '';
|
|
|
|
switch (section) {
|
|
|
|
case 'posts':
|
|
|
|
this.currentDisplay = new PostIndex(page);
|
|
|
|
break;
|
|
|
|
case 'settings':
|
|
|
|
this.currentDisplay = new SettingsIndex();
|
|
|
|
break;
|
|
|
|
case 'navigation':
|
|
|
|
this.currentDisplay = new NaviIndex();
|
|
|
|
break;
|
2018-11-20 19:42:52 -05:00
|
|
|
|
2019-02-27 11:17:51 -05:00
|
|
|
default:
|
|
|
|
// just chill
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
this.start();
|
|
|
|
}
|
|
|
|
//--------------------------
|
|
|
|
// event handlers
|
|
|
|
//--------------------------
|
|
|
|
}
|