Merge pull request #435 from webcss/patch-1
fix for #428 introduces new misbehaviour
This commit is contained in:
commit
eb3885ea5e
1 changed files with 2 additions and 1 deletions
|
|
@ -614,6 +614,7 @@ var m = (function app(window, undefined) {
|
||||||
}
|
}
|
||||||
//m.route(route, params)
|
//m.route(route, params)
|
||||||
else if (type.call(arguments[0]) === STRING) {
|
else if (type.call(arguments[0]) === STRING) {
|
||||||
|
var oldRoute = currentRoute;
|
||||||
currentRoute = arguments[0];
|
currentRoute = arguments[0];
|
||||||
var args = arguments[1] || {}
|
var args = arguments[1] || {}
|
||||||
var queryIndex = currentRoute.indexOf("?")
|
var queryIndex = currentRoute.indexOf("?")
|
||||||
|
|
@ -623,7 +624,7 @@ var m = (function app(window, undefined) {
|
||||||
var currentPath = queryIndex > -1 ? currentRoute.slice(0, queryIndex) : currentRoute
|
var currentPath = queryIndex > -1 ? currentRoute.slice(0, queryIndex) : currentRoute
|
||||||
if (querystring) currentRoute = currentPath + (currentPath.indexOf("?") === -1 ? "?" : "&") + querystring;
|
if (querystring) currentRoute = currentPath + (currentPath.indexOf("?") === -1 ? "?" : "&") + querystring;
|
||||||
|
|
||||||
var shouldReplaceHistoryEntry = (arguments.length === 3 ? arguments[2] : arguments[1]) === true || currentRoute === arguments[0];
|
var shouldReplaceHistoryEntry = (arguments.length === 3 ? arguments[2] : arguments[1]) === true || oldRoute === arguments[0];
|
||||||
|
|
||||||
if (window.history.pushState) {
|
if (window.history.pushState) {
|
||||||
computePostRedrawHook = function() {
|
computePostRedrawHook = function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue