Permalink
Browse files

Merge branch 'section_10_8' into section_10_9

  • Loading branch information...
2 parents df3f72b + cc3c597 commit 6d887809bc5308b5fb90e0149bfd2692bb270978 Noel Rappin committed Dec 8, 2012
@@ -48,8 +48,9 @@ TimeTravel.Routers.TripRouter = Backbone.Router.extend({
//##detail
tripDetail: function(id) {
var trip = TimeTravel.getTrip(id);
+ var order = new TimeTravel.Models.Order({trip: this.model});
trip.fetchData();
- this.basicPage(new TimeTravel.Views.TripDetailView({model: trip}));
+ this.basicPage(new TimeTravel.Views.TripDetailView({model: trip, order: order}));
}
//##detail
@@ -3,6 +3,10 @@ TimeTravel.Views.TripDetailView = Backbone.View.extend({
className: 'trip span-20',
//##render
+ initialize: function(options) {
+ this.order = options.order || new TimeTravel.Models.Order({trip: this.model});
+ },
+
render: function() {
this.basicRender();
this.hotelRender(this.hotelsView());
@@ -28,8 +32,7 @@ TimeTravel.Views.TripDetailView = Backbone.View.extend({
//##orders
ordersView: function() {
- return new TimeTravel.Views.OrderView({
- model: new TimeTravel.Models.Order({trip: this.model})});
+ return new TimeTravel.Views.OrderView({model: this.order});
},
ordersRender: function(orderView) {

0 comments on commit 6d88780

Please sign in to comment.