Add link in hamburger menu to switch between mobile and desktop views

This commit is contained in:
Neil Lalonde
2013-08-29 15:19:28 -04:00
parent 4827634df9
commit 82bc6b677f
7 changed files with 36 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ module ApplicationHelper
end
def html_classes
mobile_view? ? 'mobile' : ''
"#{mobile_view? ? 'mobile-view' : ''} #{mobile_device? ? 'mobile-device' : ''}"
end
def escape_unicode(javascript)
@@ -109,7 +109,11 @@ module ApplicationHelper
if session[:mobile_view]
session[:mobile_view] == '1'
else
request.user_agent =~ /Mobile|webOS/
mobile_device?
end
end
def mobile_device?
request.user_agent =~ /Mobile|webOS/
end
end