Commit 26c08d12 authored by Thibaut Frain's avatar Thibaut Frain

Corrected bugs (newline was added on chatbox's textarea)

parent 438a3530
......@@ -41,6 +41,10 @@
gadget.props.talks[to] = new Talk(to);
}
gadget.props.talks[to].messages.push(message);
gadget.jio_put({
_id: "chatbox_history",
datas: JSON.stringify(gadget.props.talks)
});
displayMessage(message);
gadget.send($msg({
to: to,
......@@ -78,10 +82,10 @@
$(this.__element).find(".talk-input").keypress(function(e) {
var charCode = typeof e.which === "number" ? e.which : e.keyCode;
if (charCode === 13) {
e.preventDefault();
if (!e.shiftKey) {
sendInput(gadget);
} else {
e.preventDefault();
$(gadget.__element).find(".talk-input").val($(gadget.__element).find(".talk-input").val() + "\n");
}
}
......
......@@ -60,6 +60,10 @@
gadget.props.talks[to] = new Talk(to);
}
gadget.props.talks[to].messages.push(message);
gadget.jio_put({
"_id": "chatbox_history",
"datas": JSON.stringify(gadget.props.talks)
});
displayMessage(message);
gadget.send(
$msg({to: to, type: "chat"}).c('body').t(content).toString()
......@@ -110,10 +114,10 @@
$(this.__element).find(".talk-input").keypress(function (e) {
var charCode = (typeof e.which === "number") ? e.which : e.keyCode;
if (charCode === 13) {
e.preventDefault();
if (!e.shiftKey) {
sendInput(gadget);
} else {
e.preventDefault();
$(gadget.__element).find(".talk-input").val(
$(gadget.__element).find(".talk-input").val() + "\n"
);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment