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

hashchange binding still broken in mootools #216

Closed
tracer99 opened this issue Dec 19, 2012 · 6 comments
Closed

hashchange binding still broken in mootools #216

tracer99 opened this issue Dec 19, 2012 · 6 comments
Assignees
Labels
Milestone

Comments

@tracer99
Copy link
Contributor

Filed Issue #124 a couple of months ago. Was working with 1.0.7 with no issues using the hack to force mootools to support hashchange binding.
Tried upgrading to 1.1.3 and no go. hashchange events are not being captured in 1.1.3 with mootools 1.4.5 at all now no matter what I try.

JSFiddle in original ticket still holds.

Also see https://forum.javascriptmvc.com/#Topic/32525000001090201

@daffl
Copy link
Contributor

daffl commented Jan 9, 2013

The Element.NativeEvents.hashchange = 2; one-liner still fixes it though right?

@tracer99
Copy link
Contributor Author

tracer99 commented Jan 9, 2013

Edit: No. Routing hashchange event firing is now completely broken in Mootools + CanJS.

@daffl
Copy link
Contributor

daffl commented Jan 11, 2013

Yes I could confirm that. Looks like the route tests are not really testing routes with Mootools. We'll look into it.

@ghost ghost assigned daffl Jan 15, 2013
@tracer99
Copy link
Contributor Author

So,
In CanJS 1.0.7, can.bind.call(window,'hashchange', setState); was on it's own line unconditionally called if a route was created in can.route.
In CanJS 1.1.3 it's wrapped in a _setup function.
This function is called by the ready function which according to the documentation, http://donejs.com/docs.html#!can.route.ready , is there for you to manually set when you want hash binding to occur.

So calling either the private _setup method or can.route.ready(true); makes routing work again.

Note, issue #124 was not fixed in 1.1 and still requires

        Element.NativeEvents.hashchange = 2;

to work

@daffl
Copy link
Contributor

daffl commented Jan 31, 2013

Yes, I got it working that way in the mootools-routing-216 branch. Adding tests for it turned up that it doesn't work for Dojo and YUI either.
One problem is, that the _setup method is supposed to get called on document ready. Neither YUI, Dojo or Moootols seem to do that the same way as jQuery though.

@daffl
Copy link
Contributor

daffl commented Feb 4, 2013

Closed with #265

@daffl daffl closed this as completed Feb 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants