Add loading screen between leaving old party and joining new one

This commit is contained in:
Blade Barringer
2015-08-22 12:42:52 -05:00
parent 93f02363e5
commit 67e60e7d06
4 changed files with 12 additions and 2 deletions

View File

@@ -33,6 +33,7 @@
"invitedToNewParty": "You were invited to join a party! Do you want to leave this party and join <%= partyName %>?", "invitedToNewParty": "You were invited to join a party! Do you want to leave this party and join <%= partyName %>?",
"joinNewParty": "Join New Party", "joinNewParty": "Join New Party",
"declineInvitation": "Decline Invitation", "declineInvitation": "Decline Invitation",
"loadingNewParty": "Your new party is loading. Please wait...",
"newMsg": "New message in \"<%= name %>\"", "newMsg": "New message in \"<%= name %>\"",
"chat": "Chat", "chat": "Chat",
"sendChat": "Send Chat", "sendChat": "Send Chat",

View File

@@ -91,6 +91,9 @@ habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User','
$scope.leaveOldPartyAndJoinNewParty = function(newPartyId, newPartyName) { $scope.leaveOldPartyAndJoinNewParty = function(newPartyId, newPartyName) {
if (confirm('Are you sure you want to delete your party and join ' + newPartyName + '?')) { if (confirm('Are you sure you want to delete your party and join ' + newPartyName + '?')) {
Groups.Group.leave({gid: Groups.party()._id, keep:false}, undefined, function() { Groups.Group.leave({gid: Groups.party()._id, keep:false}, undefined, function() {
$scope.group = {
loadingNewParty: true
};
$scope.join({ id: newPartyId, name: newPartyName }); $scope.join({ id: newPartyId, name: newPartyName });
}); });
} }

View File

@@ -1,5 +1,5 @@
- var newParty = 'User.user.invitations.party' - var newParty = 'User.user.invitations.party'
.containter-fulid(ng-if='#{newParty}.id && party._id') .containter-fluid(ng-if='#{newParty}.id && party._id')
.row.text-center .row.text-center
.col-sm-6.col-sm-offset-3.alert.alert-warning .col-sm-6.col-sm-offset-3.alert.alert-warning
p {{::env.t('invitedToNewParty', { partyName: #{newParty}.name })}} p {{::env.t('invitedToNewParty', { partyName: #{newParty}.name })}}

View File

@@ -1,10 +1,16 @@
include ../../shared/avatar/generated_avatar include ../../shared/avatar/generated_avatar
script(type='text/ng-template', id='partials/options.social.party.html') script(type='text/ng-template', id='partials/options.social.party.html')
.container-fluid(ng-if='group.loadingNewParty')
.row.text-center: .col-xs-12
h2=env.t('loadingNewParty')
img(src='/page-loader.gif')
div(ng-if='group._id') div(ng-if='group._id')
include ./leave-party-and-join-another include ./leave-party-and-join-another
include ./group include ./group
div(ng-if='!group._id') div(ng-if='!group._id && !group.loadingNewParty')
div(ng-show='user.invitations.party.id').container-fluid div(ng-show='user.invitations.party.id').container-fluid
h2=env.t('invitedTo', {name: '{{user.invitations.party.name}}'}) h2=env.t('invitedTo', {name: '{{user.invitations.party.name}}'})
a.btn.btn-success(data-type='party', ng-click='join(user.invitations.party)')=env.t('accept') a.btn.btn-success(data-type='party', ng-click='join(user.invitations.party)')=env.t('accept')