Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getFragment instead of getHash to check for initial route match #5

Merged
merged 1 commit into from
Jun 8, 2012

Conversation

jtuulos
Copy link
Contributor

@jtuulos jtuulos commented May 30, 2012

This fixes SubRoute when using pushState. getFragment will fall back to getHash if pushState isn't supported

This fixes SubRoute when using pushState. getFragment will fall back to getHash if pushState isn't supported
@geekdave
Copy link
Contributor

geekdave commented Jun 8, 2012

Thanks for the contribution Jyri, and sorry for the delay! I've reviewed and tested your change and am merging it now.

geekdave added a commit that referenced this pull request Jun 8, 2012
Use getFragment instead of getHash to check for initial route match
@geekdave geekdave merged commit eca5fbc into BackboneSubroute:master Jun 8, 2012
@geekdave
Copy link
Contributor

Thanks for reporting, @MMRandy . I'm reverting to getHash() for now.

@jtuulos , I won't have time to sort out the issue that MMRandy described for at least a few weeks. If you find a solution that allows lazy-loading of subrouters please let me know.

@ses4j
Copy link

ses4j commented Oct 26, 2012

Just weighing in -- I'm using backbone 1.9.0 with pushState in Chrome and getHash was crashing, but getFragment works okay. Can we just use something like this?

        if (Backbone.history.fragment)
            var hash = Backbone.history.getFragment();
        else
            var hash = Backbone.history.getHash();

Updating to backbone 1.9.2 obviates the need for this patch though.

davbo added a commit to davbo/backbone.subroute that referenced this pull request Dec 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants