Skip to content

Commit

Permalink
HTML5FrontEnd: Fix iPad check and iOS isMobile (HaxeFlixel#1901)
Browse files Browse the repository at this point in the history
  • Loading branch information
DleanJeans authored and Aurel300 committed Apr 17, 2018
1 parent ad6551a commit fe9488e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions flixel/system/frontEnds/HTML5FrontEnd.hx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class HTML5FrontEnd
{
return WINDOWS;
}
else if (userAgentContains("Mac"))
else if (userAgentContains("Mac") && !userAgentContains("iPad"))
{
return MAC;
}
Expand Down Expand Up @@ -92,8 +92,14 @@ class HTML5FrontEnd

private function getIsMobile():Bool
{
return [ANDROID, BLACKBERRY, WINDOWS_PHONE,
IOS(IPHONE), IOS(IPAD), IOS(IPOD)].contains(platform);
return
switch (platform)
{
case ANDROID, BLACKBERRY, WINDOWS_PHONE, IOS(_):
true;
default:
false;
};
}

private function userAgentContains(substring:String, toLowerCase:Bool = false)
Expand Down Expand Up @@ -153,4 +159,4 @@ enum FlxIOSDevice
IPAD;
IPOD;
}
#end
#end

0 comments on commit fe9488e

Please sign in to comment.