MDL-46633 chat: Chat send button gets stuck

This commit is contained in:
shashirepo 2014-08-07 15:03:29 +05:30
parent e609e6cf02
commit b12c3878a7

View File

@ -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) {