mirror of
https://github.com/nasa/openmct.git
synced 2025-06-17 14:48:13 +00:00
[Mobile] Hide Back Button
When you are at the highest level the back button fades out and is unclickable. When you are able to go up a level the back button appears/fades in and is pressable. Also removed the object type name from the header.
This commit is contained in:
@ -132,10 +132,31 @@ define(
|
||||
// is not the root, then user is navigated to
|
||||
// parent
|
||||
function navigateToParent() {
|
||||
var parent = navigationService.getNavigation().getCapability('context').getParent();
|
||||
var parent = navigationService.getNavigation().getCapability('context').getParent(),
|
||||
grandparent;
|
||||
if (parent.getId() !== ROOT_ID) {
|
||||
grandparent = parent.getCapability('context').getParent().getId();
|
||||
navigateTo(parent);
|
||||
if (grandparent && grandparent !== ROOT_ID) {
|
||||
$scope.atRoot = false;
|
||||
} else {
|
||||
$scope.atRoot = true;
|
||||
}
|
||||
} else {
|
||||
$scope.atRoot = true;
|
||||
}
|
||||
console.log($scope.atRoot);
|
||||
}
|
||||
|
||||
function checkRoot() {
|
||||
var parent = navigationService.getNavigation().getCapability('context').getParent(),
|
||||
grandparent;
|
||||
if (parent.getId() !== ROOT_ID) {
|
||||
$scope.atRoot = false;
|
||||
} else {
|
||||
$scope.atRoot = true;
|
||||
}
|
||||
console.log($scope.atRoot);
|
||||
}
|
||||
|
||||
// Load the root object, put it in the scope.
|
||||
@ -170,6 +191,8 @@ define(
|
||||
});
|
||||
|
||||
$scope.backArrow = navigateToParent;
|
||||
|
||||
$scope.checkRoot = checkRoot;
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user