Hi Tracy-
Here is something that might help you: I've got a global var set outside my define or require to account for whether or not the app is being accessed by a mobile or desktop os:
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function() {
return navigator.userAgent.match(/Opera Mini/i);
},
Windows: function() {
return navigator.userAgent.match(/IEMobile/i);
},
any: function() {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
}
};
Then inside my ready function I setup a conditional:
if (isMobile.any()){
document.getElementById("locate_form").style.visibility= "visible"; //hidden test condtion switcher//
} else{
document.getElementById("locate_form").style.visibility= "hidden"; //visible test condtion switcher//
}
and then the dom element "locate_form" visibility property then hides or displays the dijit or control. In this case, I am hiding or displaying the geolocate button based on the OS detected:
<div id="cpCenter" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'">
<div id="divSearch"></div>
<form id="locate_form">
<div id="LocateButton"></div>
</form>
</div>
I understand that this is not the most elegent method and is somewhat of a quick and dirty mediaQuery, but it does work and i would think it should be fairly easy to swap out say a dojo FilteringSelect with a dojox element. It's actually something I want to try next-
I have also used this method for controlling snapping using the snapping manager here
Syntax Help: If else containing constructor options
with a little assistance from Robert Scheitlin, GISP
Hope this helps
David