Added start party option, locales, and plus button

This commit is contained in:
TheHollidayInn
2015-05-11 20:18:35 -05:00
parent 5513061d80
commit e3f5c22fe8
4 changed files with 26 additions and 8 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,17 @@ 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){