fix multiview for just one view, god hope that bug isnt in production

This commit is contained in:
Peter Cottle 2015-04-20 14:05:28 +10:00
parent 48c418072e
commit e54d65f927
2 changed files with 39 additions and 32 deletions

View file

@ -148,26 +148,6 @@ var LeftRightView = PositiveNegativeBase.extend({
tagName: 'div',
className: 'leftRightView box horizontal center',
template: _.template($('#left-right-template').html()),
events: {
'click .left': 'negative',
'click .exit': 'exit',
'click .right': 'positive'
},
exit: function() {
this.pipeEvents.trigger('exit');
LeftRightView.__super__.exit.apply(this);
},
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) {
@ -188,7 +168,28 @@ var LeftRightView = PositiveNegativeBase.extend({
};
this.render();
// For some weird reason backbone events arent working anymore so
// im going to just wire this up manually
this.$('div.right').click(this.positive.bind(this));
this.$('div.left').click(this.negative.bind(this));
this.$('div.exit').click(this.exit.bind(this));
},
exit: function() {
this.pipeEvents.trigger('exit');
LeftRightView.__super__.exit.apply(this);
},
positive: function() {
this.pipeEvents.trigger('positive');
LeftRightView.__super__.positive.apply(this);
},
negative: function() {
this.pipeEvents.trigger('negative');
LeftRightView.__super__.negative.apply(this);
}
});
var ModalView = Backbone.View.extend({