From f69a12a912d425c9d2b4a456a0cbbb2378babd44 Mon Sep 17 00:00:00 2001 From: shpuld Date: Wed, 11 Apr 2018 00:17:05 +0300 Subject: [PATCH 1/3] Make chat collapsable and expandable, make chat look a tiny bit nicer (still works like crap when it comes to scrolling) --- src/components/chat_panel/chat_panel.js | 7 +++- src/components/chat_panel/chat_panel.vue | 49 +++++++++++++++++++----- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/components/chat_panel/chat_panel.js b/src/components/chat_panel/chat_panel.js index b146c5d9..afde7352 100644 --- a/src/components/chat_panel/chat_panel.js +++ b/src/components/chat_panel/chat_panel.js @@ -2,7 +2,8 @@ const chatPanel = { data () { return { currentMessage: '', - channel: null + channel: null, + collapsed: false } }, computed: { @@ -12,8 +13,12 @@ const chatPanel = { }, methods: { submit (message) { + console.log(this.currentMessage) this.$store.state.chat.channel.push('new_msg', {text: message}, 10000) this.currentMessage = '' + }, + togglePanel () { + this.collapsed = !this.collapsed } } } diff --git a/src/components/chat_panel/chat_panel.vue b/src/components/chat_panel/chat_panel.vue index 50bd0017..9339dfb6 100644 --- a/src/components/chat_panel/chat_panel.vue +++ b/src/components/chat_panel/chat_panel.vue @@ -1,35 +1,54 @@ From 49aa2d5fb7e13398c2fde83966cb8ae2fe228008 Mon Sep 17 00:00:00 2001 From: shpuld Date: Wed, 11 Apr 2018 00:19:28 +0300 Subject: [PATCH 2/3] cleanup --- src/components/chat_panel/chat_panel.js | 1 - src/components/chat_panel/chat_panel.vue | 22 ++++++---------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/components/chat_panel/chat_panel.js b/src/components/chat_panel/chat_panel.js index afde7352..d528d0a1 100644 --- a/src/components/chat_panel/chat_panel.js +++ b/src/components/chat_panel/chat_panel.js @@ -13,7 +13,6 @@ const chatPanel = { }, methods: { submit (message) { - console.log(this.currentMessage) this.$store.state.chat.channel.push('new_msg', {text: message}, 10000) this.currentMessage = '' }, diff --git a/src/components/chat_panel/chat_panel.vue b/src/components/chat_panel/chat_panel.vue index 9339dfb6..969088f4 100644 --- a/src/components/chat_panel/chat_panel.vue +++ b/src/components/chat_panel/chat_panel.vue @@ -24,9 +24,7 @@
-
- -
+
@@ -77,19 +75,11 @@ .chat-input { display: flex; - form { - flex: auto; - display: flex; - input { - margin: 0.5em; - width: fill-available; - } - textarea { - flex: 1; - margin: 0.6em; - min-height: 3.5em; - resize: none; - } + textarea { + flex: 1; + margin: 0.6em; + min-height: 3.5em; + resize: none; } } From 2258c9c1e7a2d8d6919e2514b5a8cdda74a4468e Mon Sep 17 00:00:00 2001 From: shpuld Date: Wed, 11 Apr 2018 00:20:42 +0300 Subject: [PATCH 3/3] Make collapsed-state hide chat and not the wrong way around --- src/components/chat_panel/chat_panel.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/chat_panel/chat_panel.vue b/src/components/chat_panel/chat_panel.vue index 969088f4..46e011dc 100644 --- a/src/components/chat_panel/chat_panel.vue +++ b/src/components/chat_panel/chat_panel.vue @@ -1,5 +1,5 @@