Skip to content

Commit

Permalink
Restore Esc functionality (temporary)
Browse files Browse the repository at this point in the history
  • Loading branch information
Waguramu committed Sep 16, 2024
1 parent 8a730d1 commit b4a9646
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion erdblick_app/app/feature.search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {KeyboardService} from "./keyboard.service";
<div [ngClass]="{'z-index-low': sidePanelService.featureSearchOpen && sidePanelService.searchOpen}">
<p-dialog class="side-menu-dialog" header="Search Loaded Features"
[(visible)]="isPanelVisible" style="padding: 0 0.5em 0.5em 0.5em"
[position]="'topleft'" [draggable]="false" [resizable]="false" [closeOnEscape]="false"
[position]="'topleft'" [draggable]="false" [resizable]="false"
(onShow)="onShow($event)" (onHide)="onHide($event)">
<div class="feature-search-controls">
<div class="progress-bar-container">
Expand Down
15 changes: 8 additions & 7 deletions erdblick_app/app/keyboard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ export class KeyboardService {
if (!isInput) {
const key = this.getKeyCombination(event);
if (key === 'Escape' || key === 'Esc') {
if (this.dialogStack.length > 0) {
event.preventDefault();
const topDialog = this.dialogStack.pop();
if (topDialog) {
topDialog.close(new MouseEvent("mousedown"));
}
}
// TODO: make this work!
// if (this.dialogStack.length > 0) {
// event.preventDefault();
// const topDialog = this.dialogStack.pop();
// if (topDialog) {
// topDialog.close(new MouseEvent("mousedown"));
// }
// }
} else if (this.shortcuts.has(key)) {
event.preventDefault();
this.shortcuts.get(key)?.(event);
Expand Down
2 changes: 1 addition & 1 deletion erdblick_app/app/map.panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {KeyboardService} from "./keyboard.service";
template: `
<p-dialog #mapLayerDialog class="map-layer-dialog" header="" [(visible)]="layerDialogVisible"
[position]="'topleft'" [draggable]="false" [resizable]="false" (onShow)="keyboardService.dialogOnShow($event)"
(onHide)="keyboardService.dialogOnHide($event)" [closeOnEscape]="false">
(onHide)="keyboardService.dialogOnHide($event)">
<p-fieldset class="map-tab" legend="Maps and Layers">
<div class="osm-controls">
<span style="font-size: 0.9em">OSM Overlay:</span>
Expand Down

0 comments on commit b4a9646

Please sign in to comment.