Skip to content

Commit 13b228a

Browse files
committed
pushChat
1 parent 86be62f commit 13b228a

File tree

3 files changed

+26
-19
lines changed

3 files changed

+26
-19
lines changed

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<span class="mdc-list-item__text">Settings</span>
4141
</li>
4242

43-
<li class="mdc-list-item" role="menuitem">
43+
<li class="mdc-list-item" role="menuitem" v-on:click="logOut">
4444
<span class="mdc-list-item__graphic material-icons">exit_to_app</span>
4545
<span class="mdc-list-item__text">Log out</span>
4646
</li>
@@ -93,7 +93,7 @@ <h1>Blitzchat</h1>
9393

9494
<template id="contactItemTemplate">
9595

96-
<div class="contact-item" v-on:click="open">
96+
<div class="contact-item" v-on:click="open($event)">
9797
<img v-if="contact.photoURL" v-bind:src="contact.photoURL" v-bind:alt="contact.name" width="50" height="50"
9898
class="picture">
9999
<div v-else class="noimage picture">{{contact.people.length}}</div>
@@ -109,7 +109,7 @@ <h3>{{computedName}}</h3>
109109

110110
<template id="chatWindowTemplate">
111111

112-
<div class="chat-window mdc-elevation--z1" v-on:focus="focusHandler" tabindex="-1">
112+
<div class="window mdc-elevation--z1" v-on:focus="focusHandler" tabindex="-1">
113113
<div class="header mdc-elevation--z2">
114114
<div class="actions">
115115
<button class="button" v-on:click="fullscreenHandler">
@@ -161,7 +161,7 @@ <h3>{{computedName}}</h3>
161161
</template>
162162

163163
<template id="newConversationFormTemplate">
164-
<div class="new-conversation-form chat-window mdc-elevation--z1" tabindex="-1" v-on:focus="focusHandler">
164+
<div class="new-conversation-form window mdc-elevation--z1" tabindex="-1" v-on:focus="focusHandler">
165165
<button class="mdc-icon-button material-icons" v-on:click="previousPhase"
166166
v-bind:class="{disabled: form.phase == 0}">
167167
arrow_back

scripts/ui.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class UI {
2121
FLOATING: 1
2222
};
2323
var loadedUsers = {};
24-
24+
2525
var moreMenu = new MDCMenu(document.querySelector('#more-menu'));
2626
var keyListener = new window.keypress.Listener();
2727
this.vue = new Vue({
@@ -153,7 +153,11 @@ class UI {
153153
});
154154
moreMenu = new MDCMenu(document.querySelector('#more-menu'));
155155
}, 0);
156-
156+
157+
},
158+
logOut() {
159+
auth.signOut();
160+
location.reload();
157161
}
158162

159163
},
@@ -177,7 +181,10 @@ class UI {
177181
props: { 'contact': Object, 'openChat': Function },
178182
template: '#contactItemTemplate',
179183
methods: {
180-
open() {
184+
open(e) {
185+
if (e.shiftKey) {
186+
this.$root.pushChat(this.contact)
187+
};
181188
this.$root.openChat(this.contact);
182189
}
183190
},
@@ -266,7 +273,7 @@ class UI {
266273
this.messageText = ''; // clear
267274

268275
that.vue.dbref.ref('blitzchat/conversations/' + this.chat.key).child('messages').push(message);
269-
276+
270277

271278
},
272279
getMessages() {
@@ -430,7 +437,7 @@ class UI {
430437
template: '#messageTemplate',
431438
props: { 'message': Object },
432439
data: () => ({
433-
440+
434441
}),
435442
methods: {
436443
urlify(text) {

styles/index.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ body {
262262
top: 52px;
263263
}
264264

265-
.chat-window {
265+
.window {
266266
height: 100%;
267267
border-radius: 10px;
268268
transition: left 100ms ease, width 100ms ease, height 100ms ease, box-shadow 100ms ease, background 100ms ease;
@@ -272,12 +272,12 @@ body {
272272
position:relative;
273273
}
274274

275-
#chat-grid:not(.single) .chat-window:focus, #chat-grid:not(.single) .chat-window:focus-within {
275+
#chat-grid:not(.single) .window:focus, #chat-grid:not(.single) .window:focus-within {
276276
box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, .12);
277277
background: rgba(255, 255, 255, 0.09);
278278
}
279279

280-
.chat-window .header, .send-message {
280+
.window .header, .send-message {
281281
width: calc(100% - 34px);
282282
height: 24px;
283283
z-index: 1;
@@ -437,7 +437,7 @@ body {
437437
color: #2288ff;
438438
}
439439

440-
.chat-window .header .title {
440+
.window .header .title {
441441
font-size: 18px;
442442
margin-left: 4px;
443443
display: inline-block;
@@ -447,32 +447,32 @@ body {
447447
width: calc(100% - 84px);
448448
}
449449

450-
.chat-window .header .actions.right {
450+
.window .header .actions.right {
451451
float: right;
452452
margin-right: -2px;
453453
}
454454

455-
.chat-window .header .actions .button {
455+
.window .header .actions .button {
456456
backdrop-filter: none;
457457
background: transparent;
458458
margin-left: 4px;
459459
padding: 0;
460460
color: #ffffff77;
461461
}
462462

463-
.chat-window .header .actions .button:hover {
463+
.window .header .actions .button:hover {
464464
color: #2288ff;
465465
}
466466

467-
.chat-window .header .actions .close:hover {
467+
.window .header .actions .close:hover {
468468
color: #ff2222;
469469
}
470470

471-
.chat-window .header .actions.right .button {
471+
.window .header .actions.right .button {
472472
float: right;
473473
}
474474

475-
.chat-window .header .actions {
475+
.window .header .actions {
476476
display: inline-block;
477477
margin-left: -4px;
478478
}

0 commit comments

Comments
 (0)