Skip to content

Commit

Permalink
refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
Pop John committed Oct 28, 2024
1 parent 4dcebf3 commit 6154e3d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
//
// SPDX-License-Identifier: Apache-2.0

import { PopoverPosition } from '../enums/popover-position.enum';
import { PopoverCSSSize } from '../types/popover-css-size.type';

export const DEFAUlT_POPOVER_WIDTH: PopoverCSSSize = '200px';
export const DEFAUlT_POPOVER_HEIGHT: PopoverCSSSize = '80px';

export const DEFAULT_POPOVER_POSITION_VALUE: 'top' | 'bottom' | 'left' | 'right' = 'top';
export const DEFAULT_POPOVER_POSITION_VALUE: PopoverPosition = PopoverPosition.TOP;

export const DEFAULT_POPOVER_FADE_IN_OUT_ANIMATION_DURATION: number = 150;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export enum PopoverPosition {
TOP = 'top',
LEFT = 'left',
RIGHT = 'right',
BOTTOM = 'bottom'
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@

import { OverlayConfig } from '@angular/cdk/overlay';
import { PopoverActionTypeEnum } from '../enums/popover-action-type.enum';
import { PopoverPosition } from '../enums/popover-position.enum';
import { PopoverStatus } from '../enums/popover-status.enum';
import { PopoverCSSSize } from '../types/popover-css-size.type';

export interface PopoverConfig extends OverlayConfig {
data?: any;
position?: 'top' | 'bottom' | 'left' | 'right';
position?: PopoverPosition;
closePopoverOnBackdropClick?: boolean;
closePopoverOnEscKeyUp?: boolean;
width?: PopoverCSSSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { delay, filter, take } from 'rxjs';
import { ScriptActions } from '../../../../../../state/core/script/script.actions';
import { PopoverRef } from '../../../../../core/components/ms-popover';
import { PopoverPosition } from '../../../../../core/components/ms-popover/models/enums/popover-position.enum';
import { PopoverService } from '../../../../../core/components/ms-popover/service/popover.service';
import { ScriptFacadeService } from '../../../../../core/services/script-facade.service';
import { isScriptActive } from '../../../../../model-compression/models/enums/script-status.enum';
Expand Down Expand Up @@ -93,7 +94,7 @@ export class MsTerminalToolbarComponent implements OnInit, OnDestroy {
MsTerminalToolbarSearchPopoverComponent,
origin._elementRef,
{
position: !this.isFullscreen ? 'top' : 'bottom',
position: !this.isFullscreen ? PopoverPosition.TOP : PopoverPosition.BOTTOM,
width: '200px',
height: '60px'
},
Expand Down

0 comments on commit 6154e3d

Please sign in to comment.