mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 01:10:04 +02:00
button clicking and left right nav integration for git demonstration view
This commit is contained in:
parent
0c4319911e
commit
e0c4ac795b
5 changed files with 143 additions and 14 deletions
|
@ -146,13 +146,29 @@ var LeftRightView = PositiveNegativeBase.extend({
|
|||
'click .right': 'positive'
|
||||
},
|
||||
|
||||
positive: function() {
|
||||
this.pipeEvents.trigger('positive');
|
||||
LeftRightView.__super__.positive.apply(this);
|
||||
},
|
||||
|
||||
negative: function() {
|
||||
this.pipeEvents.trigger('negative');
|
||||
LeftRightView.__super__.negative.apply(this);
|
||||
},
|
||||
|
||||
initialize: function(options) {
|
||||
if (!options.destination || !options.events) {
|
||||
throw new Error('needmore');
|
||||
}
|
||||
|
||||
this.destination = options.destination;
|
||||
this.navEvents = options.events;
|
||||
|
||||
// we switch to a system where every leftrightview has its own
|
||||
// events system to add support for git demonstration view taking control of the
|
||||
// click events
|
||||
this.pipeEvents = options.events;
|
||||
this.navEvents = _.clone(Backbone.Events);
|
||||
|
||||
this.JSON = {
|
||||
showLeft: (options.showLeft === undefined) ? true : options.showLeft,
|
||||
lastNav: (options.lastNav === undefined) ? false : options.lastNav
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue