member tree sync fixes

This commit is contained in:
perploug
2013-11-05 11:17:43 +01:00
parent 725ef52243
commit c9f29a443d
2 changed files with 13 additions and 4 deletions

View File

@@ -2,16 +2,15 @@
<div class="umb-pane">
<h5>Create a new member</h5>
<ul class="umb-actions umb-actions-child">
<li ng-repeat="docType in allowedTypes">
<a href="#members/member/edit/{{currentNode.id}}?doctype={{docType.alias}}&create=true" ng-click="nav.hideNavigation()">
<a href="#member/member/edit/{{currentNode.id}}?doctype={{docType.alias}}&create=true" ng-click="nav.hideNavigation()">
<i class="large {{docType.icon}}"></i>
<i class="large icon-users"></i>
<span class="menu-label">{{docType.name}}
<small>{{docType.description}}</small>
<small>{{docType.description}}</small>
</span>
</a>
</li>

View File

@@ -9,6 +9,7 @@
function MemberEditController($scope, $routeParams, $location, $q, $window, memberResource, entityResource, navigationService, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, fileManager, formHelper, treeService) {
$scope.nav = navigationService;
if ($routeParams.create) {
//we are creating so get an empty member item
@@ -37,6 +38,13 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, memb
$scope.loaded = true;
$scope.content = data;
//build a path to sync the tree with
var path = data.name[0]+"," + data.key;
path = path.replace(/-/g,'');
navigationService.setActiveTreeType("member");
navigationService.syncPath(path.split(","), true);
//in one particular special case, after we've created a new item we redirect back to the edit
// route but there might be server validation errors in the collection which we need to display
// after the redirect, so we will bind all subscriptions which will show the server validation errors
@@ -47,6 +55,8 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, memb
}
$scope.options = function(content){
if(!content.id){
return;