mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-12 15:44:25 +02:00
click handlers
This commit is contained in:
parent
9ddfaf2f18
commit
ee02aea414
6 changed files with 65 additions and 18 deletions
|
@ -307,10 +307,24 @@ var VisBranch = VisBase.extend({
|
|||
.attr(this.getAttributes().arrow);
|
||||
this.set('arrow', arrow);
|
||||
|
||||
this.attachClickHandlers();
|
||||
rect.toFront();
|
||||
text.toFront();
|
||||
},
|
||||
|
||||
attachClickHandlers: function() {
|
||||
var commandStr = 'git checkout ' + this.get('branch').get('id');
|
||||
var Main = require('../app');
|
||||
var objs = [this.get('rect'), this.get('text'), this.get('arrow')];
|
||||
|
||||
_.each(objs, function(rObj) {
|
||||
rObj.click(function() {
|
||||
Main.getEvents().trigger('processCommandFromEvent', commandStr);
|
||||
});
|
||||
$(rObj.node).css('cursor', 'pointer');
|
||||
});
|
||||
},
|
||||
|
||||
updateName: function() {
|
||||
this.get('text').attr({
|
||||
text: this.getName()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue