mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
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:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user