V8: Add back button to listviews for members (#5158)

* Add back button to edit member

* Don't set illegal location (with querystring params)
This commit is contained in:
Kenn Jacobsen
2019-04-22 10:21:38 +02:00
committed by Sebastiaan Janssen
parent 8b6fbee47e
commit 32104fff41
2 changed files with 17 additions and 7 deletions

View File

@@ -13,8 +13,10 @@
menu="page.menu"
hide-icon="true"
hide-description="true"
hide-alias="true">
</umb-editor-header>
hide-alias="true"
show-back-button="showBack()"
on-back="onBack()">
</umb-editor-header>
<umb-editor-container class="form-horizontal">

View File

@@ -15,14 +15,9 @@ function MemberEditController($scope, $routeParams, $location, appState, memberR
$scope.page.menu.currentSection = appState.getSectionState("currentSection");
$scope.page.menu.currentNode = null; //the editors affiliated node
$scope.page.nameLocked = false;
$scope.page.listViewPath = null;
$scope.page.saveButtonState = "init";
$scope.page.exportButton = "init";
$scope.page.listViewPath = ($routeParams.page && $routeParams.listName)
? "/member/member/list/" + $routeParams.listName + "?page=" + $routeParams.page
: null;
//build a path to sync the tree with
function buildTreePath(data) {
return $routeParams.listName ? "-1," + $routeParams.listName : "-1";
@@ -192,6 +187,19 @@ function MemberEditController($scope, $routeParams, $location, appState, memberR
};
$scope.showBack = function () {
return !!$routeParams.listName;
}
/** Callback for when user clicks the back-icon */
$scope.onBack = function () {
$location.path("/member/member/list/" + $routeParams.listName);
$location.search("listName", null);
if ($routeParams.page) {
$location.search("page", $routeParams.page);
}
};
$scope.export = function() {
var memberKey = $scope.content.key;
memberResource.exportMemberData(memberKey);