Skip to content

Commit

Permalink
MDL-46633 chat: Chat send button gets stuck
Browse files Browse the repository at this point in the history
  • Loading branch information
shashitechno committed Aug 28, 2014
1 parent e609e6c commit b12c387
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions mod/chat/gui_ajax/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,27 @@ M.mod_chat_ajax.init = function(Y, cfg) {
},

send : function(e, beep) {
this.sendbutton.set('value', M.str.chat.sending);
var data = {
chat_message : (!beep) ? this.messageinput.get('value') : '',
chat_sid : this.cfg.sid,
theme : this.cfg.theme
};
if (beep) {
data.beep = beep
}
data.action = 'chat';
if((this.messageinput.get('value') != '') || (typeof beep != 'undefined')) {
this.sendbutton.set('value', M.str.chat.sending);
var data = {
chat_message : (!beep) ? this.messageinput.get('value') : '',
chat_sid : this.cfg.sid,
theme : this.cfg.theme
};
if (beep) {
data.beep = beep
}
data.action = 'chat';

Y.io(this.api, {
method : 'POST',
data : build_querystring(data),
on : {
success : this.send_callback
},
context : this
});
Y.io(this.api, {
method : 'POST',
data : build_querystring(data),
on : {
success : this.send_callback
},
context : this
});
}
},

send_callback : function(tid, outcome, args) {
Expand Down

0 comments on commit b12c387

Please sign in to comment.