diff --git a/build/bundle.js b/build/bundle.js index 9ad42b0a..32bfe239 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -8685,7 +8685,10 @@ var LeftRightView = PositiveNegativeBase.extend({ this.destination = options.destination; this.navEvents = options.events; - this.JSON = {}; + this.JSON = { + showLeft: (options.showLeft === undefined) ? true : options.showLeft, + lastNav: (options.lastNav === undefined) ? false : options.lastNav + }; this.render(); } @@ -13791,21 +13794,23 @@ var MultiView = Backbone.View.extend({ return view; }, - addNavToView: function(view) { + addNavToView: function(view, index) { var leftRight = new LeftRightView({ events: this.navEvents, // we want the arrows to be on the same level as the content (not // beneath), so we go one level up with getDestination() - destination: view.getDestination() + destination: view.getDestination(), + showLeft: (index !== 0), + lastNav: (index === this.childViewJSONs.length - 1) }); }, render: function() { // go through each and render... show the first - _.each(this.childViewJSONs, function(childViewJSON) { + _.each(this.childViewJSONs, function(childViewJSON, index) { var childView = this.createChildView(childViewJSON); this.childViews.push(childView); - this.addNavToView(childView); + this.addNavToView(childView, index); }, this); this.showViewIndex(this.currentIndex); @@ -16892,7 +16897,10 @@ var LeftRightView = PositiveNegativeBase.extend({ this.destination = options.destination; this.navEvents = options.events; - this.JSON = {}; + this.JSON = { + showLeft: (options.showLeft === undefined) ? true : options.showLeft, + lastNav: (options.lastNav === undefined) ? false : options.lastNav + }; this.render(); } @@ -17099,21 +17107,23 @@ var MultiView = Backbone.View.extend({ return view; }, - addNavToView: function(view) { + addNavToView: function(view, index) { var leftRight = new LeftRightView({ events: this.navEvents, // we want the arrows to be on the same level as the content (not // beneath), so we go one level up with getDestination() - destination: view.getDestination() + destination: view.getDestination(), + showLeft: (index !== 0), + lastNav: (index === this.childViewJSONs.length - 1) }); }, render: function() { // go through each and render... show the first - _.each(this.childViewJSONs, function(childViewJSON) { + _.each(this.childViewJSONs, function(childViewJSON, index) { var childView = this.createChildView(childViewJSON); this.childViews.push(childView); - this.addNavToView(childView); + this.addNavToView(childView, index); }, this); this.showViewIndex(this.currentIndex); diff --git a/src/index.html b/src/index.html index c357db2b..b996ca4e 100644 --- a/src/index.html +++ b/src/index.html @@ -160,11 +160,19 @@ diff --git a/src/js/views/index.js b/src/js/views/index.js index 1b761deb..9906ae14 100644 --- a/src/js/views/index.js +++ b/src/js/views/index.js @@ -89,7 +89,10 @@ var LeftRightView = PositiveNegativeBase.extend({ this.destination = options.destination; this.navEvents = options.events; - this.JSON = {}; + this.JSON = { + showLeft: (options.showLeft === undefined) ? true : options.showLeft, + lastNav: (options.lastNav === undefined) ? false : options.lastNav + }; this.render(); } diff --git a/src/js/views/multiView.js b/src/js/views/multiView.js index 381d3f43..c0a70a27 100644 --- a/src/js/views/multiView.js +++ b/src/js/views/multiView.js @@ -91,21 +91,23 @@ var MultiView = Backbone.View.extend({ return view; }, - addNavToView: function(view) { + addNavToView: function(view, index) { var leftRight = new LeftRightView({ events: this.navEvents, // we want the arrows to be on the same level as the content (not // beneath), so we go one level up with getDestination() - destination: view.getDestination() + destination: view.getDestination(), + showLeft: (index !== 0), + lastNav: (index === this.childViewJSONs.length - 1) }); }, render: function() { // go through each and render... show the first - _.each(this.childViewJSONs, function(childViewJSON) { + _.each(this.childViewJSONs, function(childViewJSON, index) { var childView = this.createChildView(childViewJSON); this.childViews.push(childView); - this.addNavToView(childView); + this.addNavToView(childView, index); }, this); this.showViewIndex(this.currentIndex);