V8: Add back button to listviews in media (#5116)
This commit is contained in:
committed by
Sebastiaan Janssen
parent
59df7f1399
commit
8b6fbee47e
@@ -14,7 +14,9 @@
|
||||
hide-description="true"
|
||||
hide-alias="true"
|
||||
navigation="content.apps"
|
||||
on-select-navigation-item="appChanged(item)">
|
||||
on-select-navigation-item="appChanged(item)"
|
||||
show-back-button="showBack()"
|
||||
on-back="onBack()">
|
||||
</umb-editor-header>
|
||||
|
||||
<umb-editor-container>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
function mediaEditController($scope, $routeParams, $q, appState, mediaResource,
|
||||
entityResource, navigationService, notificationsService, localizationService,
|
||||
serverValidationManager, contentEditingHelper, fileManager, formHelper,
|
||||
editorState, umbRequestHelper, $http, eventsService) {
|
||||
editorState, umbRequestHelper, $http, eventsService, $location) {
|
||||
|
||||
var evts = [];
|
||||
var nodeId = null;
|
||||
@@ -279,6 +279,17 @@ function mediaEditController($scope, $routeParams, $q, appState, mediaResource,
|
||||
}
|
||||
}
|
||||
|
||||
$scope.showBack = function () {
|
||||
return !infiniteMode && !!$scope.page.listViewPath;
|
||||
}
|
||||
|
||||
/** Callback for when user clicks the back-icon */
|
||||
$scope.onBack = function() {
|
||||
if ($scope.page.listViewPath) {
|
||||
$location.path($scope.page.listViewPath);
|
||||
}
|
||||
};
|
||||
|
||||
//ensure to unregister from all events!
|
||||
$scope.$on('$destroy', function () {
|
||||
for (var e in evts) {
|
||||
|
||||
Reference in New Issue
Block a user