Plato on Github
Report Home
controller.js
Maintainability
76.05
Lines of code
22
Difficulty
9.88
Estimated Errors
0.12
Function weight
By Complexity
By SLOC
// Marionette Controller // --------------------- // // A multi-purpose object to use as a controller for // modules and routers, and as a mediator for workflow // and coordination of other objects, views, and more. Marionette.Controller = function(options){ this.triggerMethod = Marionette.triggerMethod; this.options = options || {}; if (_.isFunction(this.initialize)){ this.initialize(this.options); } }; Marionette.Controller.extend = Marionette.extend; // Controller Methods // -------------- // Ensure it can trigger events with Backbone.Events _.extend(Marionette.Controller.prototype, Backbone.Events, { close: function(){ this.stopListening(); this.triggerMethod("close"); this.unbind(); } });