<template lang="pug">
-.row
- .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
- // TODO: Chat modal sur petit écran, dans la page pour grand écran
- .card.smallpad
- h4 Chat
- p(v-for="chat in chats" :class="classObject(chat)" v-html="chat.msg")
- input#inputChat(type="text" :placeholder="st.tr['Type here']"
- @keyup.enter="sendChat")
- button#sendChatBtn(@click="sendChat") {{ st.tr["Send"] }}
+#chat.card
+ h4 Chat
+ p(v-for="chat in chats" :class="classObject(chat)" v-html="chat.msg")
+ input#inputChat(type="text" :placeholder="st.tr['Type here']"
+ @keyup.enter="sendChat")
+ button#sendChatBtn(@click="sendChat") {{ st.tr["Send"] }}
</template>
<script>
};
},
created: function() {
+ const curMsgListener = this.st.conn.onmessage; //from Game or Hall
const socketMessageListener = msg => {
+ curMsgListener(msg);
const data = JSON.parse(msg.data);
if (data.code == "newchat") //only event at this level
{
};
</script>
-<style lang="sass">
+<style lang="sass" scoped>
.my-chatmsg
color: grey
.opp-chatmsg
color: black
+#chat
+ max-width: 100%
</style>