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

Fix to leave alone JSON (or other non-HTML) requests #29

Merged
merged 1 commit into from
Feb 12, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/mobile-fu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ def force_tablet_format
# 'Tablet' view.

def set_mobile_format
if !mobile_exempt? && is_mobile_device? && !request.xhr?
if request.format.html? && !mobile_exempt? && is_mobile_device? && !request.xhr?
request.format = :mobile unless session[:mobile_view] == false
session[:mobile_view] = true if session[:mobile_view].nil?
elsif !mobile_exempt? && is_tablet_device? && !request.xhr?
elsif request.format.html? && !mobile_exempt? && is_tablet_device? && !request.xhr?
request.format = :tablet unless session[:tablet_view] == false
session[:tablet_view] = true if session[:tablet_view].nil?
end
Expand Down