Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Fixed bug that manage page reload when description is clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
whs committed Oct 14, 2015
1 parent 54717a1 commit aa0ad49
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 21 deletions.
24 changes: 9 additions & 15 deletions ui/static/app/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ app.controller('GroupManageController', function($scope, $http, $location){
}
$scope.acceptMember = acceptMember;
$scope.denyMember = denyMember;

$http.get('/api/group/'+groupID).then(function(data){
$scope.group = data.data;
});

$scope.editInfo = function(){
$http.put('/api/group/'+groupID+'/edit/',$scope.group).success(function(data){
});
}
})


Expand All @@ -63,20 +72,5 @@ app.controller('GroupCategoryController', function($scope, $http, $stateParams){
});

});


app.controller('AdminPageController', function($scope, $http, $location){
var groupID = $location.path().split('/')[2];

$http.get('/api/group/'+groupID).then(function(data){
$scope.group = data.data;
});
$scope.editInfo = function(){
console.log("type: "+$scope.group)
$http.put('/api/group/'+groupID+'/edit/',$scope.group).success(function(data){
});
}

})

})();
5 changes: 0 additions & 5 deletions ui/static/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ app.config(function($stateProvider, $urlRouterProvider) {
templateUrl: 'templates/groupmanage.html',
controller: 'GroupManageController'
})
.state('root.group.edit', {
url: '/edit',
templateUrl: 'templates/groupmanage.html',
controller: 'AdminPageController'
})
.state('root.lfg', {
url: '/groups/browse',
templateUrl: 'templates/groupbrowser.html',
Expand Down
2 changes: 1 addition & 1 deletion ui/static/templates/groupmanage.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</table>
</div>
</tab>
<tab heading="Description &amp; Settings" ui-sref="root.group.edit()" class="settings" >
<tab heading="Description &amp; Settings" class="settings">
<form action="">
<div class="form-group">
<h4>What's this group about</h4>
Expand Down

0 comments on commit aa0ad49

Please sign in to comment.