mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-07 17:23:56 -05:00
Notebooks: Fix callout dialog being cut off at the bottom of the document (#14579)
* add above position for callout dialog * use if else
This commit is contained in:
@@ -278,11 +278,12 @@ export class MarkdownToolbarComponent extends AngularDisposable {
|
||||
const triggerHeight = triggerElement.offsetHeight;
|
||||
const triggerWidth = triggerElement.offsetWidth;
|
||||
const dialogProperties = { xPos: triggerPosX, yPos: triggerPosY, width: triggerWidth, height: triggerHeight };
|
||||
const dialogPosition = window.innerHeight - triggerPosY < 250 ? 'above' : 'below';
|
||||
let calloutOptions;
|
||||
|
||||
if (type === MarkdownButtonType.LINK_PREVIEW) {
|
||||
const defaultLabel = this.getCurrentSelectionText();
|
||||
this._linkCallout = this._instantiationService.createInstance(LinkCalloutDialog, this.insertLinkHeading, dialogProperties, defaultLabel);
|
||||
this._linkCallout = this._instantiationService.createInstance(LinkCalloutDialog, this.insertLinkHeading, dialogProperties, dialogPosition, defaultLabel);
|
||||
this._linkCallout.render();
|
||||
calloutOptions = await this._linkCallout.open();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user