rewrite: chat & leave-group bug fixes

This commit is contained in:
Tyler Renelle 2013-08-31 23:41:01 -04:00
parent 14ddad958e
commit 2672b7f6ab
3 changed files with 5 additions and 5 deletions

View file

@ -49,14 +49,14 @@ habitrpg
});
//$scope._chatMessage = '';
$scope.postChat = function(group, message){
$scope.postChat = function(group, $event){
//FIXME ng-model makes this painfully slow! using jquery for now, which is really non-angular-like
message = $('.chat-textarea').val();
var message = $($event.target).val();
if (_.isEmpty(message)) return
$('.chat-btn').addClass('disabled');
group.$postChat({message:message}, function(data){
//$scope._chatMessage = '';
$('.chat-textarea').val('');
$($event.target).val('');
group.chat = data.chat;
$('.chat-btn').removeClass('disabled');
});

View file

@ -1,6 +1,6 @@
form(ng-submit='postChat(group,_chatMessage)')
//FIXME ng-model makes this painfully slow! using jquery for now, which is really non-angular-like
//textarea.span6(rows='3', ui-keypress='{13:"postChat(group,_chatMessage)"}', ng-model='_chatMessage')
textarea.span6.chat-textarea(rows='3', ui-keypress='{13:"postChat(group,_chatMessage)"}')
textarea.span6.chat-textarea(rows='3', ui-keypress='{13:"postChat(group,$event)"}')
br
input.btn.chat-btn(type='submit', value='Send Chat')

View file

@ -82,7 +82,7 @@ a.pull-right.gem-wallet(rel='popover', data-trigger='hover', data-title='Guild B
//-{else}
//- No challenges yet, visit the <span class=label><i class=icon-bullhorn></i> Challenges</span> tab to create one.
//-{/}
a.btn.btn-danger(data-id='{{group.id}}', x-bind='click:groupLeave') Leave
a.btn.btn-danger(data-id='{{group.id}}', ng-click='leave(group)') Leave
.span8
div(ng-if='group.leader==user.id')