mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 22:28:13 +00:00
[Mobile] CleanUp/Tests
Added tests inside spec files for the QueryService, TreeNodeController, and InfoGesture. Also cleaned up the tree so that padding is used between buttons instead of margins.
This commit is contained in:
@ -88,7 +88,7 @@ define(
|
||||
}
|
||||
|
||||
function checkMobile() {
|
||||
return queryService.isMobile();
|
||||
return queryService.isMobile(navigator.userAgent);
|
||||
}
|
||||
|
||||
// Consider the currently-navigated object and update
|
||||
|
@ -40,16 +40,15 @@ define(
|
||||
// Gets the UA name if it is one of the following.
|
||||
// If it is not (a desktop for example) nothing is
|
||||
// returned instead
|
||||
function getDeviceUA() {
|
||||
var ua = navigator.userAgent;
|
||||
function getDeviceUA(ua) {
|
||||
return ua.match(/iPad|iPhone|Android/i) ?
|
||||
ua.match(/iPad|iPhone|Android/i) : "";
|
||||
}
|
||||
|
||||
// Checks if gotten device is mobile,
|
||||
// Mobile is defined as a phone or tablet
|
||||
function isMobile() {
|
||||
if (getDeviceUA()) {
|
||||
function isMobile(ua) {
|
||||
if (getDeviceUA(ua)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user