mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 22:47:03 +03:00
Code refactoring
Flow first look
This commit is contained in:
parent
2f841524cb
commit
e6e0b02849
71 changed files with 2092 additions and 1836 deletions
|
|
@ -5,9 +5,12 @@ import {isArray, isNonEmptyArray, noop} from 'Common/Utils';
|
|||
|
||||
class AbstractScreen
|
||||
{
|
||||
oCross = null;
|
||||
sScreenName;
|
||||
aViewModels;
|
||||
|
||||
constructor(screenName, viewModels = [])
|
||||
{
|
||||
this.oCross = null;
|
||||
this.sScreenName = screenName;
|
||||
this.aViewModels = isArray(viewModels) ? viewModels : [];
|
||||
}
|
||||
|
|
@ -54,8 +57,11 @@ class AbstractScreen
|
|||
fMatcher = _.bind(this.onRoute || noop, this);
|
||||
route = crossroads.create();
|
||||
|
||||
_.each(routes, (aItem) => {
|
||||
route.addRoute(aItem[0], fMatcher).rules = aItem[1];
|
||||
_.each(routes, (item) => {
|
||||
if (item && route)
|
||||
{
|
||||
route.addRoute(item[0], fMatcher).rules = item[1];
|
||||
}
|
||||
});
|
||||
|
||||
this.oCross = route;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue