mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-30 17:54:28 +02:00
nice dynamic arrows
This commit is contained in:
parent
cab63cbce0
commit
7acde81510
4 changed files with 40 additions and 17 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue