File tree Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Original file line number Diff line number Diff line change 242
242
243
243
< template id ="windowWrapperTemplate ">
244
244
< div class ="window-wrapper ">
245
- < chat-window v-if ="window.type == TYPE.CHAT " :chat ="window.content "> </ chat-window >
245
+ < chat-window v-if ="window.type == TYPE.CHAT " :chat ="window.content " :window =" window " > </ chat-window >
246
246
< new-conversation-form v-if ="window.type == TYPE.NEWCHAT " :window ="window " :form ="window.content.form ">
247
247
</ new-conversation-form >
248
248
</ div >
Original file line number Diff line number Diff line change @@ -182,10 +182,19 @@ class UI {
182
182
template : '#contactItemTemplate' ,
183
183
methods : {
184
184
open ( e ) {
185
- if ( e . shiftKey ) {
186
- this . $root . pushChat ( this . contact )
185
+ if ( e . shiftKey ) {
186
+ this . $root . pushChat ( this . contact ) ;
187
+ var that = this ;
188
+ setTimeout ( function ( ) {
189
+ var all = document . querySelectorAll ( '.window-wrapper' ) ;
190
+ var length = that . $root . openedChats . length ;
191
+ for ( var i = 0 ; i < all . length ; i ++ ) {
192
+ all [ i ] . style . height = 'calc(' + ( 100 / Math . ceil ( length / 2 ) ) + 'vh - ' + ( 70 / Math . ceil ( length / 2 ) ) + 'px)' ;
193
+ }
194
+ } , 0 ) ;
195
+ } else {
196
+ this . $root . openChat ( this . contact ) ;
187
197
} ;
188
- this . $root . openChat ( this . contact ) ;
189
198
}
190
199
} ,
191
200
computed : {
@@ -250,6 +259,14 @@ class UI {
250
259
close ( ) {
251
260
var index = that . vue . openedChats . indexOf ( this . window ) ;
252
261
that . vue . openedChats . splice ( index , 1 ) ;
262
+ setTimeout ( function ( ) {
263
+ var all = document . querySelectorAll ( '.window-wrapper' ) ;
264
+ var length = that . vue . openedChats . length ;
265
+ console . log ( 'calc(' + ( 100 / Math . ceil ( length / 2 ) ) + 'vh - ' + ( 70 / Math . ceil ( length / 2 ) ) + 'px)' ) ;
266
+ for ( var i = 0 ; i < all . length ; i ++ ) {
267
+ all [ i ] . style . height = 'calc(' + ( 100 / Math . ceil ( length / 2 ) ) + 'vh - ' + ( 70 / Math . ceil ( length / 2 ) ) + 'px)' ;
268
+ }
269
+ } , 0 ) ;
253
270
} ,
254
271
focusHandler ( ) {
255
272
that . vue . focusedChat = this ;
Original file line number Diff line number Diff line change @@ -260,6 +260,8 @@ body {
260
260
position : absolute;
261
261
right : 16px ;
262
262
top : 52px ;
263
+ display : grid;
264
+ grid-template-columns : auto auto;
263
265
}
264
266
265
267
.window {
@@ -457,7 +459,7 @@ body {
457
459
background : transparent;
458
460
margin-left : 4px ;
459
461
padding : 0 ;
460
- color : # ffffff77 ;
462
+ color : # ffffff77 ;
461
463
}
462
464
463
465
.window .header .actions .button : hover {
@@ -479,7 +481,7 @@ body {
479
481
480
482
.window-wrapper {
481
483
height : calc (100vh - 70px );
482
- transition : left 300ms ease, width 300 ms ease , height 300ms ease;
484
+ transition : left 300ms ease, top 300ms ease;
483
485
animation : window-wrapper-open 400ms ;
484
486
z-index : 0 ;
485
487
}
You can’t perform that action at this time.
0 commit comments