From 02dfb95deec306f5212b0b21e5ccca65df860716 Mon Sep 17 00:00:00 2001 From: Reto Kaiser Date: Fri, 25 Apr 2014 09:06:15 +0200 Subject: [PATCH] Use cm.router's location in abstract page's ready --- library/CM/App.js | 4 ++-- library/CM/Page/Abstract.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/CM/App.js b/library/CM/App.js index e55d77997..28518844e 100644 --- a/library/CM/App.js +++ b/library/CM/App.js @@ -1136,7 +1136,7 @@ var CM_App = CM_Class_Abstract.extend({ /** * @returns Location */ - _getLocation: function() { + getLocation: function() { return window.history.location || document.location; }, @@ -1144,7 +1144,7 @@ var CM_App = CM_Class_Abstract.extend({ * @returns string */ _getFragment: function() { - var location = this._getLocation(); + var location = this.getLocation(); return location.pathname + location.search; }, diff --git a/library/CM/Page/Abstract.js b/library/CM/Page/Abstract.js index 76aa6dd34..3326e4c75 100644 --- a/library/CM/Page/Abstract.js +++ b/library/CM/Page/Abstract.js @@ -20,7 +20,7 @@ var CM_Page_Abstract = CM_Component_Abstract.extend({ CM_Component_Abstract.prototype._ready.call(this); if (this.hasStateParams()) { - var location = window.location; + var location = cm.router.getLocation(); var params = queryString.parse(location.search); var state = _.pick(params, _.intersection(_.keys(params), this.getStateParams())); this.routeToState(state, location.pathname + location.search);