Add ipados-device class, move ios-device class to clientside

This commit is contained in:
Penar Musaraj 2024-12-12 22:07:05 -05:00
parent cc901cc8e6
commit 76243fce15
3 changed files with 8 additions and 9 deletions

View File

@ -8,5 +8,13 @@ export default {
} else {
html.classList.add("no-touch", "discourse-no-touch");
}
if (caps.isIpadOS) {
html.classList.add("ipados-device");
}
if (caps.isIOS) {
html.classList.add("ios-device");
}
},
};

View File

@ -175,7 +175,6 @@ module ApplicationHelper
list = []
list << (mobile_view? ? "mobile-view" : "desktop-view")
list << (mobile_device? ? "mobile-device" : "not-mobile-device")
list << "ios-device" if ios_device?
list << "rtl" if rtl?
list << text_size_class
list << "anon" unless current_user
@ -446,10 +445,6 @@ module ApplicationHelper
MobileDetection.mobile_device?(request.user_agent)
end
def ios_device?
MobileDetection.ios_device?(request.user_agent)
end
def customization_disabled?
request.env[ApplicationController::NO_THEMES]
end

View File

@ -20,10 +20,6 @@ module MobileDetection
end
end
def self.ios_device?(user_agent)
user_agent =~ /iPad|iPhone|iPod/
end
MODERN_MOBILE_REGEX =
%r{
\(.*iPhone\ OS\ 1[5-9].*\)|