mirror of
https://github.com/Ekokumppanit/Lentolaskuri.git
synced 2026-02-11 21:46:12 +00:00
Initial commit
This commit is contained in:
40
app/scripts/app.js
Normal file
40
app/scripts/app.js
Normal file
@@ -0,0 +1,40 @@
|
||||
'use strict';
|
||||
|
||||
define([
|
||||
'collections/route',
|
||||
'collections/results',
|
||||
'views/route',
|
||||
'views/leginput',
|
||||
'views/roundtrip',
|
||||
'views/passengers',
|
||||
'views/map',
|
||||
'views/total',
|
||||
'views/operation'
|
||||
], function (Route, Results, RouteView, LegInput, RoundtripInput, PassengersInput, MapView, TotalView, OperationView) {
|
||||
|
||||
var App = function () {
|
||||
this.initialize = function () {
|
||||
this.route = new Route();
|
||||
|
||||
this.legInput = new LegInput({collection: this.route});
|
||||
this.roundtripInput = new RoundtripInput();
|
||||
this.passengersInput = new PassengersInput();
|
||||
|
||||
this.routeView = new RouteView({collection: this.route});
|
||||
this.mapView = new MapView({collection: this.route});
|
||||
|
||||
// Order is important. ResultsView requires that Route legs are
|
||||
// on dom as ResultView references from and to legs to calculate
|
||||
// position.
|
||||
this.results = new Results([], {route: this.route});
|
||||
this.totalView = new TotalView({model: this.results.total});
|
||||
|
||||
new OperationView();
|
||||
};
|
||||
|
||||
this.initialize();
|
||||
};
|
||||
|
||||
return App;
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user