diff --git a/api/router.js b/api/router.js index ccfccb94..6f805de2 100644 --- a/api/router.js +++ b/api/router.js @@ -15,7 +15,7 @@ module.exports = function($window, redrawService) { if (render != null) redrawService.render(root, render(Vnode(component, attrs.key, attrs))) } var bail = function() { - routeService.setPath(defaultRoute) + routeService.setPath(defaultRoute, null, { replace: true }) } routeService.defineRoutes(routes, function(payload, params, path) { var update = lastUpdate = function(routeResolver, comp) { diff --git a/api/tests/test-router.js b/api/tests/test-router.js index 7e2454cb..47bc1ac5 100644 --- a/api/tests/test-router.js +++ b/api/tests/test-router.js @@ -51,7 +51,7 @@ o.spec("route", function() { o(root.firstChild.nodeName).equals("DIV") }) - o("routed mount points can redraw synchronoulsy (#1275)", function() { + o("routed mount points can redraw synchronously (#1275)", function() { var view = o.spy() $window.location.href = prefix + "/" @@ -78,6 +78,8 @@ o.spec("route", function() { callAsync(function() { o(root.firstChild.nodeName).equals("DIV") + o($window.location.pathname).equals("/a") + $window.history.back() o($window.location.pathname).equals("/") diff --git a/mithril.js b/mithril.js index a27e1734..104a4dac 100644 --- a/mithril.js +++ b/mithril.js @@ -1098,7 +1098,7 @@ var _20 = function($window, redrawService0) { if (render1 != null) redrawService0.render(root, render1(Vnode(component, attrs3.key, attrs3))) } var bail = function() { - routeService.setPath(defaultRoute) + routeService.setPath(defaultRoute, null, { replace: true }) } routeService.defineRoutes(routes, function(payload, params, path) { var update = lastUpdate = function(routeResolver, comp) { diff --git a/mithril.min.js b/mithril.min.js index f31212e4..dc602474 100644 --- a/mithril.min.js +++ b/mithril.min.js @@ -36,6 +36,6 @@ decodeURIComponent(g[1]):"";"true"===g?g=!0:"false"===g&&(g=!1);var l=m.split(/\ l&&(l=m(function(){l=null;a()}))}}function d(a,c,d){var b=a.indexOf("?"),g=a.indexOf("#"),k=-1