projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adjustments, handle keyStrokes on BaseGame
[vchess.git]
/
client
/
src
/
components
/
Chat.vue
diff --git
a/client/src/components/Chat.vue
b/client/src/components/Chat.vue
index
0570752
..
980cd17
100644
(file)
--- a/
client/src/components/Chat.vue
+++ b/
client/src/components/Chat.vue
@@
-1,10
+1,9
@@
<template lang="pug">
<template lang="pug">
-#chat.card
- h4 Chat
- p(v-for="chat in chats" :class="classObject(chat)" v-html="chat.msg")
+.card
input#inputChat(type="text" :placeholder="st.tr['Type here']"
@keyup.enter="sendChat")
button#sendChatBtn(@click="sendChat") {{ st.tr["Send"] }}
input#inputChat(type="text" :placeholder="st.tr['Type here']"
@keyup.enter="sendChat")
button#sendChatBtn(@click="sendChat") {{ st.tr["Send"] }}
+ p(v-for="chat in chats" :class="classObject(chat)" v-html="chat.msg")
</template>
<script>
</template>
<script>
@@
-26,7
+25,7
@@
export default {
const data = JSON.parse(msg.data);
if (data.code == "newchat") //only event at this level
{
const data = JSON.parse(msg.data);
if (data.code == "newchat") //only event at this level
{
- this.chats.
push
({msg:data.msg,
+ this.chats.
unshift
({msg:data.msg,
name:data.name || "@nonymous", sid:data.from});
}
};
name:data.name || "@nonymous", sid:data.from});
}
};
@@
-52,7
+51,7
@@
export default {
chatInput.value = "";
const chat = {msg:chatTxt, name: this.st.user.name || "@nonymous",
sid:this.st.user.sid};
chatInput.value = "";
const chat = {msg:chatTxt, name: this.st.user.name || "@nonymous",
sid:this.st.user.sid};
- this.chats.
push
(chat);
+ this.chats.
unshift
(chat);
this.st.conn.send(JSON.stringify({
code:"newchat", msg:chatTxt, name:chat.name}));
},
this.st.conn.send(JSON.stringify({
code:"newchat", msg:chatTxt, name:chat.name}));
},