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

Comments

Projects
None yet
2 participants
@tracer99
Contributor

tracer99 commented Dec 19, 2012

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

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Jan 9, 2013

Contributor

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

Contributor

daffl commented Jan 9, 2013

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

@tracer99

This comment has been minimized.

Show comment
Hide comment
@tracer99

tracer99 Jan 9, 2013

Contributor

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

Contributor

tracer99 commented Jan 9, 2013

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

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Jan 11, 2013

Contributor

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

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

This comment has been minimized.

Show comment
Hide comment
@tracer99

tracer99 Jan 31, 2013

Contributor

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

Contributor

tracer99 commented Jan 31, 2013

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

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Jan 31, 2013

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Feb 4, 2013

Contributor

Closed with #265

Contributor

daffl commented Feb 4, 2013

Closed with #265

@daffl daffl closed this Feb 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment