diff --git a/common/locales/en/groups.json b/common/locales/en/groups.json index 1b6833c276..94f6ca73a3 100644 --- a/common/locales/en/groups.json +++ b/common/locales/en/groups.json @@ -21,7 +21,7 @@ "communityGuidelinesRead2": "before chatting.", "party": "Party", "createAParty": "Create A Party", - "updatedParty": "Party settings updated. Please refresh the page to see the changes.", + "updatedParty": "Party settings updated.", "noPartyText": "You are either not in a party or your party is taking a while to load. You can either create one and invite friends, or if you want to join an existing party, have them enter your Unique User ID below and then come back here to look for the invitation:", "LFG": "To advertise your new party or find one to join, go to the <%= linkStart %>Party Wanted (Looking for Group)<%= linkEnd %> Guild.", "create": "Create", diff --git a/website/public/js/controllers/headerCtrl.js b/website/public/js/controllers/headerCtrl.js index ada83f24c2..9424eca81d 100644 --- a/website/public/js/controllers/headerCtrl.js +++ b/website/public/js/controllers/headerCtrl.js @@ -4,9 +4,20 @@ habitrpg.controller("HeaderCtrl", ['$scope', 'Groups', 'User', function($scope, Groups, User) { $scope.Math = window.Math; + $scope.user = User.user; $scope.party = Groups.party(function(){ - $scope.partyMinusSelf = _.sortBy( + var triggerResort = function() { + $scope.partyMinusSelf = resortParty(); + }; + + triggerResort(); + $scope.$watch('user.party.order', triggerResort); + $scope.$watch('user.party.orderAscending', triggerResort); + }); + + function resortParty() { + var result = _.sortBy( _.filter($scope.party.members, function(member){ return member._id !== User.user._id; }), @@ -41,8 +52,10 @@ habitrpg.controller("HeaderCtrl", ['$scope', 'Groups', 'User', } ) if (User.user.party.orderAscending == "descending") { - $scope.partyMinusSelf = $scope.partyMinusSelf.reverse() + result = result.reverse() } - }); + + return result; + } } ]);