Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix routing.

  • Loading branch information...
commit 001962e32d2db1138dbc0a24f51b75e14d2ed50b 1 parent f0fdafc
@paulmillr paulmillr authored
Showing with 18 additions and 10 deletions.
  1. +9 −5 public/javascripts/vendor.js
  2. +9 −5 vendor/scripts/chaplin-2e2fa6c1.js
View
14 public/javascripts/vendor.js
@@ -12259,8 +12259,8 @@ Handlebars.template = Handlebars.VM.template;
});
};
- Application.prototype.initRouter = function(routes) {
- this.router = new Router();
+ Application.prototype.initRouter = function(routes, options) {
+ this.router = new Router(options);
if (typeof routes === "function") routes(this.router.match);
return this.router.startHistory();
};
@@ -12672,9 +12672,11 @@ Handlebars.template = Handlebars.VM.template;
_(Router.prototype).extend(Subscriber);
- function Router() {
+ function Router(options) {
+ this.options = options;
this.route = __bind(this.route, this);
- this.match = __bind(this.match, this); this.subscribeEvent('!router:route', this.routeHandler);
+ this.match = __bind(this.match, this);
+ this.subscribeEvent('!router:route', this.routeHandler);
this.subscribeEvent('!router:changeURL', this.changeURLHandler);
this.createHistory();
}
@@ -12684,8 +12686,10 @@ Handlebars.template = Handlebars.VM.template;
};
Router.prototype.startHistory = function() {
+ var pushState, _ref;
+ pushState = (_ref = this.options.pushState) != null ? _ref : true;
return Backbone.history.start({
- pushState: true
+ pushState: pushState
});
};
View
14 vendor/scripts/chaplin-2e2fa6c1.js
@@ -112,8 +112,8 @@
});
};
- Application.prototype.initRouter = function(routes) {
- this.router = new Router();
+ Application.prototype.initRouter = function(routes, options) {
+ this.router = new Router(options);
if (typeof routes === "function") routes(this.router.match);
return this.router.startHistory();
};
@@ -525,9 +525,11 @@
_(Router.prototype).extend(Subscriber);
- function Router() {
+ function Router(options) {
+ this.options = options;
this.route = __bind(this.route, this);
- this.match = __bind(this.match, this); this.subscribeEvent('!router:route', this.routeHandler);
+ this.match = __bind(this.match, this);
+ this.subscribeEvent('!router:route', this.routeHandler);
this.subscribeEvent('!router:changeURL', this.changeURLHandler);
this.createHistory();
}
@@ -537,8 +539,10 @@
};
Router.prototype.startHistory = function() {
+ var pushState, _ref;
+ pushState = (_ref = this.options.pushState) != null ? _ref : true;
return Backbone.history.start({
- pushState: true
+ pushState: pushState
});
};
Please sign in to comment.
Something went wrong with that request. Please try again.