Permalink
Browse files

rebuild and test...

  • Loading branch information...
1 parent 282b92f commit ea6c52cfc7d1c4d46fb7699169622055564f018a @robrobbins robrobbins committed Aug 8, 2013
Showing with 6 additions and 7 deletions.
  1. +5 −3 build/debug/sudo.js
  2. +1 −1 extras/navigator/navigator.js
  3. +0 −3 extras/navigator/spec/navigator-qs.spec.js
View
@@ -874,9 +874,9 @@ sudo.Navigator.prototype = Object.create(sudo.Model.prototype);
sudo.Navigator.prototype.getFragment = function getFragment(fragment) {
var root = this.data.root;
if(!fragment) {
- // intentional use of coersion
+ // intentional use of coersion
if (this.isPushState) {
- fragment = window.location.pathname + window.location.search + window.location.hash;
+ fragment = window.location.pathname;
root = root.replace(this.trailingStripper, '');
if(!fragment.indexOf(root)) fragment = fragment.substr(root.length);
} else {
@@ -1034,7 +1034,9 @@ sudo.Navigator.prototype.urlChanged = function urlChanged(fragment) {
// nothing has changed
if (current === this.data.fragment) return false;
this.data.fragment = current;
- this.data.query = this.getSearch(current) || this.getHash(current);
+ // the fragment and the href need to checked here, optimized for the 'go' scenario
+ this.data.query = (this.getSearch(current) || this.getSearch()) ||
+ (this.getHash(current) || this.getHash());
return true;
};
// ## Observable Extension Object
@@ -182,7 +182,7 @@ sudo.Navigator.prototype.urlChanged = function urlChanged(fragment) {
// nothing has changed
if (current === this.data.fragment) return false;
this.data.fragment = current;
- // the fragment and the href need to checked here
+ // the fragment and the href need to checked here, optimized for the 'go' scenario
this.data.query = (this.getSearch(current) || this.getSearch()) ||
(this.getHash(current) || this.getHash());
return true;
@@ -68,10 +68,7 @@ describe('Sudo Navigator Class -- PushState', function() {
it('should parse query string', function() {
var $a = nav.start(anchor);
expect(nav.get('query')).toEqual('query=someQuery');
- expect(nav.get('/')).toEqual({query: 'someQuery'});
});
-
-
});

0 comments on commit ea6c52c

Please sign in to comment.