[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:
Shivam Dave
2015-08-24 16:17:58 -07:00
parent c4dd4f5c45
commit 6a2bdd103b
5 changed files with 25 additions and 8 deletions

View File

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