forked from biggerboat/backbone-command
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbackbone-command.min.js
More file actions
4 lines (4 loc) · 939 Bytes
/
Copy pathbackbone-command.min.js
File metadata and controls
4 lines (4 loc) · 939 Bytes
1
2
3
4
/*! backbone-command - v0.1.3 - 2015-07-28
* Copyright (c) 2015 Paul Tondeur;
*/
(function(e,n){if("function"==typeof define&&define.amd)define(["underscore","backbone"],function(e,o){n(e,o)});else if("undefined"!=typeof exports&&"function"==typeof require){var o=require("underscore"),t=require("backbone");n(o,t)}else n(e._,e.Backbone)})(this,function(e,n){n.Command=function(e){this._configure(e||{})},e.extend(n.Command.prototype,{injector:"inject",_configure:function(e){void 0!==e.injector&&e.injector.injectInto(this)},execute:function(){}}),n.Command.extend=n.Router.extend;var o=n.Router.prototype._bindRoutes;n.CommandRouter=n.Router.extend({injector:null,_bindRoutes:function(){this.injector=new injector.Injector,o()},bindCommand:function(e,n,o){e.on(n,this._executeCommand,{command:o,options:{injector:this.injector}})},_executeCommand:function(){var e=new this.command(this.options);e.execute.apply(e,arguments),e=null}})});