mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add link in hamburger menu to switch between mobile and desktop views
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user