mirror of
https://github.com/discourse/discourse.git
synced 2025-02-10 21:34:50 +00:00
Add ipados-device class, move ios-device class to clientside
This commit is contained in:
parent
cc901cc8e6
commit
76243fce15
@ -8,5 +8,13 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
html.classList.add("no-touch", "discourse-no-touch");
|
html.classList.add("no-touch", "discourse-no-touch");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (caps.isIpadOS) {
|
||||||
|
html.classList.add("ipados-device");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (caps.isIOS) {
|
||||||
|
html.classList.add("ios-device");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -175,7 +175,6 @@ module ApplicationHelper
|
|||||||
list = []
|
list = []
|
||||||
list << (mobile_view? ? "mobile-view" : "desktop-view")
|
list << (mobile_view? ? "mobile-view" : "desktop-view")
|
||||||
list << (mobile_device? ? "mobile-device" : "not-mobile-device")
|
list << (mobile_device? ? "mobile-device" : "not-mobile-device")
|
||||||
list << "ios-device" if ios_device?
|
|
||||||
list << "rtl" if rtl?
|
list << "rtl" if rtl?
|
||||||
list << text_size_class
|
list << text_size_class
|
||||||
list << "anon" unless current_user
|
list << "anon" unless current_user
|
||||||
@ -446,10 +445,6 @@ module ApplicationHelper
|
|||||||
MobileDetection.mobile_device?(request.user_agent)
|
MobileDetection.mobile_device?(request.user_agent)
|
||||||
end
|
end
|
||||||
|
|
||||||
def ios_device?
|
|
||||||
MobileDetection.ios_device?(request.user_agent)
|
|
||||||
end
|
|
||||||
|
|
||||||
def customization_disabled?
|
def customization_disabled?
|
||||||
request.env[ApplicationController::NO_THEMES]
|
request.env[ApplicationController::NO_THEMES]
|
||||||
end
|
end
|
||||||
|
@ -20,10 +20,6 @@ module MobileDetection
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.ios_device?(user_agent)
|
|
||||||
user_agent =~ /iPad|iPhone|iPod/
|
|
||||||
end
|
|
||||||
|
|
||||||
MODERN_MOBILE_REGEX =
|
MODERN_MOBILE_REGEX =
|
||||||
%r{
|
%r{
|
||||||
\(.*iPhone\ OS\ 1[5-9].*\)|
|
\(.*iPhone\ OS\ 1[5-9].*\)|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user