@@ -176,6 +176,7 @@ export class InteractiveEditorWidget {
176
176
177
177
private _lastDim : Dimension | undefined ;
178
178
private _isLayouting : boolean = false ;
179
+ private _expansionState : ExpansionState = ExpansionState . NOT_CROPPED ;
179
180
180
181
constructor (
181
182
parentEditor : ICodeEditor ,
@@ -357,8 +358,6 @@ export class InteractiveEditorWidget {
357
358
this . _store . dispose ( ) ;
358
359
this . _ctxInputEmpty . reset ( ) ;
359
360
this . _ctxMessageCropState . reset ( ) ;
360
- console . log ( 'inside of dispose' ) ;
361
- console . log ( 'this._ctxMessageCropState.get() : ' , this . _ctxMessageCropState . get ( ) ) ;
362
361
}
363
362
364
363
get domNode ( ) : HTMLElement {
@@ -431,34 +430,22 @@ export class InteractiveEditorWidget {
431
430
this . _onDidChangeHeight . fire ( ) ;
432
431
}
433
432
434
- cropState ( ) {
435
- if ( this . _elements . message . scrollHeight > this . _elements . message . clientHeight ) {
436
- return ExpansionState . CROPPED ;
437
- } else {
438
- return ExpansionState . NOT_CROPPED ;
439
- }
433
+ expansionState ( ) {
434
+ return this . _expansionState ;
440
435
}
441
436
442
437
updateMarkdownMessage ( message : Node | undefined ) {
443
- console . log ( 'inside of update markdown message' ) ;
444
438
this . _elements . markdownMessage . classList . toggle ( 'hidden' , ! message ) ;
445
439
if ( ! message ) {
446
- this . _ctxMessageCropState . reset ( ) ;
447
- console . log ( 'inside of case when message is undefined' ) ;
448
- console . log ( 'this._ctxMessageCropState.get() : ' , this . _ctxMessageCropState . get ( ) ) ;
449
440
reset ( this . _elements . message ) ;
441
+ this . _ctxMessageCropState . reset ( ) ;
442
+ this . _expansionState = ExpansionState . NOT_CROPPED ;
450
443
} else {
451
- // reset the css to what it was before
452
444
this . _elements . message . style . webkitLineClamp = '3' ;
453
445
reset ( this . _elements . message , message ) ;
454
- console . log ( 'message overflowing : ' , this . _elements . message . scrollHeight > this . _elements . message . clientHeight ) ;
455
- if ( this . _elements . message . scrollHeight > this . _elements . message . clientHeight ) {
456
- this . _ctxMessageCropState . set ( ExpansionState . CROPPED ) ;
457
- } else {
458
- this . _ctxMessageCropState . set ( ExpansionState . NOT_CROPPED ) ;
459
- }
460
- console . log ( 'inside of the case when the message is defined' ) ;
461
- console . log ( 'this._ctxMessageCropState.get() : ' , this . _ctxMessageCropState . get ( ) ) ;
446
+ const expansionState = this . _elements . message . scrollHeight > this . _elements . message . clientHeight ? ExpansionState . CROPPED : ExpansionState . NOT_CROPPED ;
447
+ this . _ctxMessageCropState . set ( expansionState ) ;
448
+ this . _expansionState = expansionState ;
462
449
}
463
450
this . _onDidChangeHeight . fire ( ) ;
464
451
}
@@ -508,12 +495,9 @@ export class InteractiveEditorWidget {
508
495
}
509
496
510
497
updateMarkdownMessageExpansionState ( expansionState : ExpansionState ) {
511
- console . log ( 'inside of update markdown message expansion state' ) ;
512
- console . log ( 'expansionState : ' , expansionState ) ;
513
498
this . _ctxMessageCropState . set ( expansionState ) ;
514
- console . log ( ' this._ctxMessageCropState.get() : ' , this . _ctxMessageCropState . get ( ) ) ;
499
+ this . _expansionState = expansionState ;
515
500
this . _elements . message . style . webkitLineClamp = expansionState === ExpansionState . NOT_CROPPED ? 'none' : ( expansionState === ExpansionState . EXPANDED ? '10' : '3' ) ;
516
- console . log ( 'this._elements.message.style.webkitLineClamp : ' , this . _elements . message . style . webkitLineClamp ) ;
517
501
this . _onDidChangeHeight . fire ( ) ;
518
502
}
519
503
0 commit comments