Merge branch 'develop' into blade-Finish_weeklies_pr

This commit is contained in:
Blade Barringer
2015-06-04 12:45:23 -05:00
9 changed files with 95 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
"use strict";
habitrpg.controller("HeaderCtrl", ['$scope', 'Groups', 'User',
function($scope, Groups, User) {
habitrpg.controller("HeaderCtrl", ['$scope', 'Groups', 'User', '$location', '$rootScope',
function($scope, Groups, User, $location, $rootScope) {
$scope.Math = window.Math;
$scope.user = User.user;
@@ -16,6 +16,19 @@ habitrpg.controller("HeaderCtrl", ['$scope', 'Groups', 'User',
$scope.$watch('user.party.orderAscending', triggerResort);
});
$scope.inviteOrStartParty = function(group) {
if (group.type === "party") {
$rootScope.openModal('invite-friends', {
controller:'InviteToGroupCtrl',
resolve: {
injectedGroup: function(){ return group; }
}
});
} else {
$location.path("/options/groups/party");
}
}
function resortParty() {
var result = _.sortBy(
_.filter($scope.party.members, function(member){