mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-22 03:34:14 +00:00
rewrite: chat & leave-group bug fixes
This commit is contained in:
parent
14ddad958e
commit
2672b7f6ab
3 changed files with 5 additions and 5 deletions
|
|
@ -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');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in a new issue