Commit 9a0bbbe4 authored by Patrick's avatar Patrick
Browse files

new ipad test

parent b0eef9ef
...@@ -27,6 +27,12 @@ checkagent = function(){ ...@@ -27,6 +27,12 @@ checkagent = function(){
} }
function is_touch_device() {
return !!('ontouchstart' in window // works on most browsers
|| navigator.maxTouchPoints); // works on IE10/11 and Surface
};
checkIpad = function(){ checkIpad = function(){
let ipad = false; let ipad = false;
if (checkagent() && navigator.maxTouchPoints && navigator.maxTouchPoints > 2) { if (checkagent() && navigator.maxTouchPoints && navigator.maxTouchPoints > 2) {
......
...@@ -134,7 +134,7 @@ vcs.vcm.Framework.getInstance().subscribe("MAP_LOADED", function() { ...@@ -134,7 +134,7 @@ vcs.vcm.Framework.getInstance().subscribe("MAP_LOADED", function() {
var framework = vcs.vcm.Framework.getInstance(); var framework = vcs.vcm.Framework.getInstance();
if (checkagent() == true && framework.isMobile() == false){ if (checkagent() == true && framework.isMobile() == false){
vcs.vcm.Framework.loadConfig("config_safari.json") vcs.vcm.Framework.loadConfig("config_safari.json")
} else if (checkIpad() == true) { } else if (checkagent() == true && is_touch_device() == true) {
vcs.vcm.Framework.loadConfig("config_mobile.json") vcs.vcm.Framework.loadConfig("config_mobile.json")
} else{ } else{
framework.isMobile() ? vcs.vcm.Framework.loadConfig("config_mobile.json") : vcs.vcm.Framework.loadConfig("config.json") framework.isMobile() ? vcs.vcm.Framework.loadConfig("config_mobile.json") : vcs.vcm.Framework.loadConfig("config.json")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment