Sha256: 028d87cbc3f09a00fbaf946e11b1e2e38c94cdc63d2971e49a36546aa56f9ff2
Contents?: true
Size: 648 Bytes
Versions: 5
Compression:
Stored size: 648 Bytes
Contents
_.extend(Backbone.Router.prototype, Backbone.Events, { route : function(route, name, callback) { Backbone.history || (Backbone.history = new Backbone.History); if (!_.isRegExp(route)) route = this._routeToRegExp(route); Backbone.history.route(route, _.bind(function(fragment) { var args = this._extractParameters(route, fragment); if( _.isFunction( this.before ) ){ this.before.apply(this, args) } callback.apply(this, args); if( _.isFunction( this.after ) ){ this.after.apply(this, args) } this.trigger.apply(this, ['route:' + name].concat(args)); }, this)); } });
Version data entries
5 entries across 5 versions & 1 rubygems