[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:
Shivam Dave
2015-07-23 13:19:58 -07:00
parent b3bc8b6876
commit 143e3eeb6c
8 changed files with 31 additions and 18 deletions

View File

@ -88,7 +88,7 @@ define(
}
function checkMobile() {
return queryService.isMobile();
return queryService.isMobile(navigator.userAgent);
}
// Consider the currently-navigated object and update

View File

@ -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;