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

set_mobile_format's XHR filter breaks jQuery Mobile #13

Closed
mattg opened this issue Oct 24, 2010 · 8 comments
Closed

set_mobile_format's XHR filter breaks jQuery Mobile #13

mattg opened this issue Oct 24, 2010 · 8 comments

Comments

@mattg
Copy link

mattg commented Oct 24, 2010

set_mobile_format assumes that XHR requests should not use the :mobile format. I'm not sure it should have an opinion about this. jQuery Mobile makes XHR requests expecting that it will get the mobile version of a page. I really want to use jQuery Mobile, so I made the following very ugly patch in my copy:

if is_mobile_device? && !request.xhr?

to:

if is_mobile_device? && ['/','text/html'].include?(request.format)

Maybe this could be a configuration option.

@technicalpickles
Copy link

I ran into this too, it took quite a bit of debugging since it only happens in production mode.

Maybe we could have a method like should_use_mobile_format that defaults to if is_mobile_device? && !request.xhr?. This would allow jquery mobile users, or others, override it easily in application_controller.

@ankitb
Copy link

ankitb commented Jan 28, 2011

I am hitting the exact same issue (or so I think ...). None of my pages are rendering properly on a mobile device as soon as I enable Mobile fu.

I am not sure if I understand the fix above. Is there a way to force the output stream to be set mobile without changing the underlying plugin?

Thanks

@mattg
Copy link
Author

mattg commented Jan 29, 2011

ankitb, are you using jQuery Mobile? If not, then you have a different problem.

@ankitb
Copy link

ankitb commented Jan 29, 2011

Yes I am using jquery mobile.

@mattg
Copy link
Author

mattg commented Jan 31, 2011

There is a way to force the output to be mobile, but it behaves differently from when it happens on its own. Are you just getting blank pages?

@jampow
Copy link

jampow commented Apr 24, 2011

I'm with the same problem, using jQuery Touch from Sencha Labs.

@mattg did u fix this like on your first post?

@mattg
Copy link
Author

mattg commented Apr 30, 2011

I did. I've since made more modifications. I really need to make a fork.

@benlangfeld
Copy link

This project is abandoned. Please see the active fork at http://github.com/benlangfeld/mobile-fu. Please test with the released gem and master branch of the new home for the project, and file an issue on the other repo if you still have problems.

See #40.

@mattg mattg closed this as completed Oct 1, 2016
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

No branches or pull requests

5 participants