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<
535535 private _setPreviewPosition ( id : string ) : void {
536536 const intID = parseInt ( id , 10 ) ;
537537 const realTarget = document . getElementsByClassName ( TITLE_CLASS ) [ intID ] ;
538+ const newTarget = document . getElementsByClassName ( 'jp-codeSnippet-item' ) [
539+ intID
540+ ] ;
538541 // distDown is the number of pixels to shift the preview down
539542 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+ ) ;
540550 // if (realTarget.getBoundingClientRect().top > window.screen.height / 2) {
541551 // distDown = distDown - 66; //this is bumping it up further if it's close to the end of the screen
542552 // }
Original file line number Diff line number Diff line change 11: root {
22 --preview-distance : 0px ;
3+ --preview-max-height : 75px ;
34 --more-options-top : 0px ;
45 --more-options-left : 0px ;
56}
179180 padding : 5px ;
180181 width : 180px ;
181182 height : fit-content;
182- max-height : 75 px ;
183+ max-height : var ( --preview-max-height ) ;
183184 /*height: 106px;*/
184185 box-sizing : border-box;
185186 box-shadow : var (--jp-elevation-z2 );
You can’t perform that action at this time.
0 commit comments