mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 14:18:16 +00:00
[Mobile] Hide Tree
On selecting a node in the tree, if the user is on phone and in portrait, than emit up to the browse controller to call treeSlide(), which will hide the tree menu. Also adjusted the agent service to properly check for orientation using window.innerHeight/ Width. Also created function for the selection of an object in BrowseController.
This commit is contained in:
@ -87,6 +87,17 @@ define(
|
||||
}
|
||||
}
|
||||
|
||||
// Sets the selected object in the tree, to be the
|
||||
// currently represented object. If the user is on phone
|
||||
// and in portrait mode, than, hide the tree menu
|
||||
function setObject(ngModel, domainObject) {
|
||||
ngModel.selectedObject = domainObject;
|
||||
if (agentService.getOrientation() === "portrait" &&
|
||||
agentService.isPhone(navigator.userAgent)) {
|
||||
$scope.$emit('select-obj');
|
||||
}
|
||||
}
|
||||
|
||||
function checkMobile() {
|
||||
return agentService.isMobile(navigator.userAgent);
|
||||
}
|
||||
@ -157,6 +168,8 @@ define(
|
||||
|
||||
checkMobile: checkMobile,
|
||||
|
||||
setObject: setObject,
|
||||
|
||||
/**
|
||||
* Check if this not has ever been expanded.
|
||||
* @returns true if it has been expanded
|
||||
|
Reference in New Issue
Block a user