[Mobile] Back Arrow
Back Arrow implemented by getting parent and then navigating to it.
This commit is contained in:
@@ -85,6 +85,7 @@
|
||||
},
|
||||
{
|
||||
"key": "back-arrow",
|
||||
"uses": [ "type", "action" ],
|
||||
"templateUrl": "templates/back-arrow.html"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -22,6 +22,6 @@
|
||||
|
||||
<!-- Back Arrow Icon used on mobile-->
|
||||
<span ng-controller="BrowseController"
|
||||
ng-click="backArrow()">
|
||||
ng-click='backArrow()'>
|
||||
<a class='icon ui-symbol mobile-back-arrow'><</a>
|
||||
</span>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
-->
|
||||
<div class='object-header object-header-mobile'>
|
||||
<span class="label s-label">
|
||||
<mct-representation key="'back-arrow'" mct-object='domainObject'></mct-representation>
|
||||
<mct-representation key="'back-arrow'"></mct-representation>
|
||||
<span class='type-icon icon ui-symbol'>{{type.getGlyph()}}</span>
|
||||
<span ng-if="parameters.mode" class='action'>{{parameters.mode}}</span>
|
||||
<span class='type-name'>{{type.getName()}}</span>
|
||||
|
||||
@@ -126,8 +126,16 @@ define(
|
||||
}
|
||||
}
|
||||
|
||||
function updateRouteBackArrow() {
|
||||
// console.log("Back Arrow");
|
||||
// Uses the current navigation to get the
|
||||
// current ContextCapability, then the
|
||||
// parent is gotten from that. If the parent
|
||||
// is not the root, then user is navigated to
|
||||
// parent
|
||||
function navigateToParent() {
|
||||
var parent = navigationService.getNavigation().getCapability('context').getParent();
|
||||
if (parent.getId() !== ROOT_ID) {
|
||||
navigateTo(parent);
|
||||
}
|
||||
}
|
||||
|
||||
// Load the root object, put it in the scope.
|
||||
@@ -144,10 +152,12 @@ define(
|
||||
selectedObject: navigationService.getNavigation()
|
||||
};
|
||||
|
||||
// SlideMenu boolean used to hide and show
|
||||
// tree menu
|
||||
$scope.treeSlide = function () {
|
||||
$scope.treeClass = !$scope.treeClass;
|
||||
};
|
||||
|
||||
|
||||
// Listen for changes in navigation state.
|
||||
navigationService.addListener(setNavigation);
|
||||
|
||||
@@ -159,7 +169,7 @@ define(
|
||||
navigationService.removeListener(setNavigation);
|
||||
});
|
||||
|
||||
$scope.backArrow = updateRouteBackArrow;
|
||||
$scope.backArrow = navigateToParent;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user