mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 07:27:04 +03:00
Cleanup and better rename settings screens to match template names
This commit is contained in:
parent
30116c183f
commit
4dd58f7c36
83 changed files with 267 additions and 323 deletions
|
|
@ -26,17 +26,14 @@ export class AbstractScreen {
|
|||
* @returns {void}
|
||||
*/
|
||||
onStart() {
|
||||
if (!this.__started) {
|
||||
this.__started = true;
|
||||
const routes = this.routes();
|
||||
if (arrayLength(routes)) {
|
||||
let route = new Crossroads(),
|
||||
fMatcher = (this.onRoute || (()=>0)).bind(this);
|
||||
const routes = this.routes();
|
||||
if (arrayLength(routes)) {
|
||||
let route = new Crossroads(),
|
||||
fMatcher = (this.onRoute || (()=>0)).bind(this);
|
||||
|
||||
routes.forEach(item => item && route && (route.addRoute(item[0], fMatcher).rules = item[1]));
|
||||
routes.forEach(item => item && route && (route.addRoute(item[0], fMatcher).rules = item[1]));
|
||||
|
||||
this.__cross = route;
|
||||
}
|
||||
this.__cross = route;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class AbstractView {
|
|||
constructor(templateID, type)
|
||||
{
|
||||
// Object.defineProperty(this, 'viewModelTemplateID', { value: templateID });
|
||||
// this.viewModelTemplateID = this.constructor.name;
|
||||
this.viewModelTemplateID = templateID;
|
||||
this.viewType = type;
|
||||
this.viewModelDom = null;
|
||||
|
|
|
|||
|
|
@ -278,7 +278,12 @@ export const
|
|||
}
|
||||
});
|
||||
|
||||
forEachObjectValue(SCREENS, vmScreen => vmScreen.onStart());
|
||||
forEachObjectValue(SCREENS, vmScreen => {
|
||||
if (!vmScreen.__started) {
|
||||
vmScreen.onStart();
|
||||
vmScreen.__started = true;
|
||||
}
|
||||
});
|
||||
|
||||
const cross = new Crossroads();
|
||||
cross.addRoute(/^([a-zA-Z0-9-]*)\/?(.*)$/, screenOnRoute);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue