public
Created

Marionette Extensions

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
NS.Application = Marionette.Application.extend({
 
constructor: function () {
var that = this, events;
Marionette.Application.prototype.constructor.apply(this, arguments);
events = {
 
on: function (topic, func, object) {
this.vent.on(topic, func, (object ? object : undefined));
},
 
trigger: function (topic, options) {
this.vent.trigger(topic, options);
}
 
};
 
this.e = {};
this.e.on = _.bind(events.on, this);
this.e.trigger = _.bind(events.trigger, this);
}
 
});
 
NS.Application = Marionette.View.extend({
 
constructor: function () {
var that, ctl;
Marionette.View.prototype.constructor.apply(this, arguments);
 
ctl = this.options.ctl;
that = this;
 
this.on('close', function (o) { ctl.vent.off(null, null, this); });
}
 
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.