Skip to content

Commit

Permalink
Merge pull request #29 from unihallresclub/master
Browse files Browse the repository at this point in the history
Fix to leave alone JSON (or other non-HTML) requests
  • Loading branch information
benlangfeld committed Feb 12, 2013
2 parents 2d2d817 + ea9ebf0 commit 241ed33
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 241ed33

Please sign in to comment.