[Mobile] Clean-Up
Cleaned the unused code for the backArrow and long touch gestures. Commented out functions for later use Currently shows the back arrow, however, only will print to console on press. Edited tests where mobile checks were breaking and fixed.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
at runtime from the About dialog for additional information.
|
||||
-->
|
||||
|
||||
<!-- Back Arrow Icon used on mobile-->
|
||||
<span ng-controller="BrowseController"
|
||||
ng-click="backArrow()">
|
||||
<a class='icon ui-symbol mobile-back-arrow'><</a>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<mct-representation key="'object-header'" mct-object="domainObject">
|
||||
</mct-representation>
|
||||
</div>
|
||||
<!-- For now, on mobile the button bar is hidden-->
|
||||
<!-- Temporarily, on mobile, the button bar is hidden-->
|
||||
<div class="btn-bar right abs mobile-hide">
|
||||
<mct-representation key="'action-group'"
|
||||
mct-object="domainObject"
|
||||
|
||||
@@ -64,23 +64,6 @@ define(
|
||||
// domainObject
|
||||
$location.path(urlService.urlForLocation("browse", domainObject));
|
||||
}
|
||||
|
||||
function backArr() {
|
||||
var priorRoute = $route.current,
|
||||
// Act as if params HADN'T changed to avoid page reload
|
||||
unlisten;
|
||||
|
||||
unlisten = $scope.$on('$locationChangeSuccess', function () {
|
||||
// Checks path to make sure /browse/ is at front
|
||||
// if so, change $route.current
|
||||
if ($location.path().indexOf("/browse/") === 0) {
|
||||
$route.current = priorRoute;
|
||||
}
|
||||
unlisten();
|
||||
});
|
||||
console.log(urlService.urlForBack("browse", $scope.navigatedObject));
|
||||
$location.path(urlService.urlForBack("browse", $scope.navigatedObject));
|
||||
}
|
||||
|
||||
// Callback for updating the in-scope reference to the object
|
||||
// that is currently navigated-to.
|
||||
@@ -142,6 +125,10 @@ define(
|
||||
navigateTo(domainObject);
|
||||
}
|
||||
}
|
||||
|
||||
function updateRouteBackArrow() {
|
||||
console.log("Back Arrow");
|
||||
}
|
||||
|
||||
// Load the root object, put it in the scope.
|
||||
// Also, load its immediate children, and (possibly)
|
||||
@@ -172,7 +159,7 @@ define(
|
||||
navigationService.removeListener(setNavigation);
|
||||
});
|
||||
|
||||
$scope.backArrow = backArr;
|
||||
$scope.backArrow = updateRouteBackArrow;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ define(
|
||||
beforeEach(function () {
|
||||
mockScope = jasmine.createSpyObj(
|
||||
"$scope",
|
||||
[ "$on", "$watch", "treeSlide" ]
|
||||
[ "$on", "$watch", "treeSlide", "backArrow" ]
|
||||
);
|
||||
mockRoute = { current: { params: {} } };
|
||||
mockLocation = jasmine.createSpyObj(
|
||||
@@ -244,7 +244,13 @@ define(
|
||||
mockUrlService.urlForLocation(mockMode, mockNextObject)
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
// Mocks the back arrow call that
|
||||
// lets the html code know the back
|
||||
// arrow navigation needs to be done
|
||||
it("calls the backArrow function", function () {
|
||||
mockScope.backArrow();
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user