Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

abort resizing on cancel

ulferts7f001a75dc07
diff --git a/frontend/src/app/modules/grids/grid/grid.component.html b/frontend/src/app/modules/grids/grid/grid.component.html
index c39a5264288..044ba7a1c6b 100644
--- a/frontend/src/app/modules/grids/grid/grid.component.html
+++ b/frontend/src/app/modules/grids/grid/grid.component.html
@@ -35,7 +35,7 @@
</div>
<resizer *ngIf="resize.isResizable"
[customHandler]="true"
- (end)="resize.end(area, $event)"
+ (end)="resize.end(area)"
(start)="resize.start(area)"
(move)="resize.moving($event)">
<div class="grid--resizer">
diff --git a/frontend/src/app/modules/grids/grid/grid.component.ts b/frontend/src/app/modules/grids/grid/grid.component.ts
index 5b2eb5ba04c..65e45d8df5a 100644
--- a/frontend/src/app/modules/grids/grid/grid.component.ts
+++ b/frontend/src/app/modules/grids/grid/grid.component.ts
@@ -66,8 +66,12 @@ export class GridComponent implements OnDestroy, OnInit {
@HostListener('window:keyup', ['$event'])
handleKeyboardEvent(event:KeyboardEvent) {
- if (event.key === 'Escape' && this.drag.currentlyDragging) {
+ if (event.key !== 'Escape') {
+ return;
+ } else if (this.drag.currentlyDragging) {
this.drag.abort();
+ } else if (this.resize.currentlyResizing) {
+ this.resize.abort();
}
}
diff --git a/frontend/src/app/modules/grids/grid/resize.service.ts b/frontend/src/app/modules/grids/grid/resize.service.ts
index ff87a5ac5ec..ad7c5c0ae6c 100644
--- a/frontend/src/app/modules/grids/grid/resize.service.ts
+++ b/frontend/src/app/modules/grids/grid/resize.service.ts
@@ -15,14 +15,14 @@ export class GridResizeService {
readonly move:GridMoveService,
readonly drag:GridDragAndDropService) { }
- public end(area:GridWidgetArea, deltas:ResizeDelta) {
+ public end(area:GridWidgetArea) {
if (!this.resizedArea) {
return;
}
this.resizedArea = null;
- // user aborted dragging
+ // user aborted resizing
if (area.unchangedSize) {
return;
}
@@ -33,6 +33,13 @@ export class GridResizeService {
this.layout.rebuildAndPersist();
}
+ public abort() {
+ if (this.resizedArea) {
+ this.layout.resetAreas();
+ this.resizedArea = null;
+ }
+ }
+
public start(resizedArea:GridWidgetArea) {
this.resizedArea = resizedArea;