File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -535,8 +535,18 @@ export class CodeSnippetDisplay extends React.Component<
535
535
private _setPreviewPosition ( id : string ) : void {
536
536
const intID = parseInt ( id , 10 ) ;
537
537
const realTarget = document . getElementsByClassName ( TITLE_CLASS ) [ intID ] ;
538
+ const newTarget = document . getElementsByClassName ( 'jp-codeSnippet-item' ) [
539
+ intID
540
+ ] ;
538
541
// distDown is the number of pixels to shift the preview down
539
542
const distDown : number = realTarget . getBoundingClientRect ( ) . top - 43 ; //this is bumping it up
543
+ const elementSnippet = newTarget as HTMLElement ;
544
+ const heightSnippet = elementSnippet . clientHeight ;
545
+ const heightPreview = heightSnippet . toString ( 10 ) + 'px' ;
546
+ document . documentElement . style . setProperty (
547
+ '--preview-max-height' ,
548
+ heightPreview
549
+ ) ;
540
550
// if (realTarget.getBoundingClientRect().top > window.screen.height / 2) {
541
551
// distDown = distDown - 66; //this is bumping it up further if it's close to the end of the screen
542
552
// }
Original file line number Diff line number Diff line change 1
1
: root {
2
2
--preview-distance : 0px ;
3
+ --preview-max-height : 75px ;
3
4
--more-options-top : 0px ;
4
5
--more-options-left : 0px ;
5
6
}
179
180
padding : 5px ;
180
181
width : 180px ;
181
182
height : fit-content;
182
- max-height : 75 px ;
183
+ max-height : var ( --preview-max-height ) ;
183
184
/*height: 106px;*/
184
185
box-sizing : border-box;
185
186
box-shadow : var (--jp-elevation-z2 );
You can’t perform that action at this time.
0 commit comments