WIP(event): Summer Splash cont'd

Splits Quests out to a new page. Refactors inventory Jade files and controllers to more manageable structures.
This commit is contained in:
Sabe Jones
2015-07-08 16:13:23 -05:00
parent 3a2422086f
commit 78d4989544
18 changed files with 333 additions and 197 deletions

View File

@@ -1,11 +1,13 @@
"use strict";
habitrpg.controller("HeaderCtrl", ['$scope', 'Groups', 'User', '$location', '$rootScope', 'Analytics',
function($scope, Groups, User, $location, $rootScope, Analytics) {
habitrpg.controller("HeaderCtrl", ['$scope', 'Groups', 'User',
function($scope, Groups, User) {
$scope.Math = window.Math;
$scope.user = User.user;
$scope.inviteOrStartParty = Groups.inviteOrStartParty;
$scope.party = Groups.party(function(){
var triggerResort = function() {
$scope.partyMinusSelf = resortParty();
@@ -16,20 +18,6 @@ habitrpg.controller("HeaderCtrl", ['$scope', 'Groups', 'User', '$location', '$ro
$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 {
Analytics.track({'hitType':'event','eventCategory':'button','eventAction':'click','eventLabel':'Invite Friends'});
$location.path("/options/groups/party");
}
}
function resortParty() {
var result = _.sortBy(
_.filter($scope.party.members, function(member){