diff --git a/src/Umbraco.Web.UI.Client/src/views/member/edit.html b/src/Umbraco.Web.UI.Client/src/views/member/edit.html index dbaf96abc2..1bb3b34981 100644 --- a/src/Umbraco.Web.UI.Client/src/views/member/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/member/edit.html @@ -48,23 +48,29 @@ - - + + - - + + + + + diff --git a/src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js index 18b5c300db..245381d9fe 100644 --- a/src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js @@ -8,6 +8,11 @@ */ function MemberEditController($scope, $routeParams, $location, appState, memberResource, entityResource, navigationService, notificationsService, localizationService, serverValidationManager, contentEditingHelper, fileManager, formHelper, editorState, umbRequestHelper, $http) { + var infiniteMode = $scope.model && $scope.model.infiniteMode; + var id = infiniteMode ? $scope.model.id : $routeParams.id; + var create = infiniteMode ? $scope.model.create : $routeParams.create; + var listName = infiniteMode ? $scope.model.listname : $routeParams.listName; + //setup scope vars $scope.page = {}; $scope.page.loading = true; @@ -20,17 +25,17 @@ function MemberEditController($scope, $routeParams, $location, appState, memberR //build a path to sync the tree with function buildTreePath(data) { - return $routeParams.listName ? "-1," + $routeParams.listName : "-1"; + return listName ? "-1," + listName : "-1"; } - if ($routeParams.create) { + if (create) { //if there is no doc type specified then we are going to assume that // we are not using the umbraco membership provider - if ($routeParams.doctype) { + if (doctype) { //we are creating so get an empty member item - memberResource.getScaffold($routeParams.doctype) + memberResource.getScaffold(doctype) .then(function(data) { $scope.content = data; @@ -66,16 +71,16 @@ function MemberEditController($scope, $routeParams, $location, appState, memberR //The reason this might be an INT is due to the routing used for the member list view //but this is now configured to use the key, so this is just a fail safe - if ($routeParams.id && $routeParams.id.length < 9) { + if (id && id.length < 9) { - entityResource.getById($routeParams.id, "Member").then(function(entity) { + entityResource.getById(id, "Member").then(function(entity) { $location.path("/member/member/edit/" + entity.key); }); } else { //we are editing so get the content item from the server - memberResource.getByKey($routeParams.id) + memberResource.getByKey(id) .then(function(data) { $scope.content = data; @@ -84,11 +89,12 @@ function MemberEditController($scope, $routeParams, $location, appState, memberR editorState.set($scope.content); - var path = buildTreePath(data); - - //sync the tree (only for ui purposes) - navigationService.syncTree({ tree: "member", path: path.split(",") }); + if (!infiniteMode) { + var path = buildTreePath(data); + //sync the tree (only for ui purposes) + navigationService.syncTree({ tree: "member", path: path.split(",") }); + } //it's the initial load of the editor, we need to get the tree node // from the server so that we can load in the actions menu. umbRequestHelper.resourcePromise( @@ -144,7 +150,7 @@ function MemberEditController($scope, $routeParams, $location, appState, memberR passwordProp.value.reset = !passwordProp.value.oldPassword && passwordProp.config.allowManuallyChangingPassword; } - memberResource.save($scope.content, $routeParams.create, fileManager.getFiles()) + memberResource.save($scope.content, create, fileManager.getFiles()) .then(function(data) { formHelper.resetForm({ scope: $scope }); @@ -184,12 +190,12 @@ function MemberEditController($scope, $routeParams, $location, appState, memberR }; $scope.showBack = function () { - return !!$routeParams.listName; + return !!listName; } /** Callback for when user clicks the back-icon */ $scope.onBack = function () { - $location.path("/member/member/list/" + $routeParams.listName); + $location.path("/member/member/list/" + listName); $location.search("listName", null); if ($routeParams.page) { $location.search("page", $routeParams.page);