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

show grid on resizing

ulfertsa0ee2aa2dfca
diff --git a/app/assets/stylesheets/content/_grid.sass b/app/assets/stylesheets/content/_grid.sass
index e21350fe133..b52571b8af5 100644
--- a/app/assets/stylesheets/content/_grid.sass
+++ b/app/assets/stylesheets/content/_grid.sass
@@ -18,9 +18,6 @@ $grid--widget-padding: 20px
&.-drop-target
background-color: $gray-light
- &.-resize-target
- z-index: 1000
-
&.-widgeted
z-index: 10
@include widget-box--style
@@ -36,6 +33,7 @@ $grid--widget-padding: 20px
&.-resizing
border: 1px solid $primary-color
z-index: 100
+ pointer-events: none
&.-addable
display: flex
@@ -50,9 +48,10 @@ $grid--widget-padding: 20px
&.-dragged
display: none
- &.-undragged
+ &.-passive
pointer-events: none
background: #EEEEEE
+ opacity: 0.5
&.-gap
&.-row
@@ -76,11 +75,17 @@ $grid--widget-padding: 20px
icon-triggered-context-menu
visibility: hidden
- &.-drop-target
- border: 1px solid $secondary-color
+ &.-drop-target, &.-resize-target
+ border-width: 1px
+ border-style: solid
+ border-color: $secondary-color
+ transition: border-color 0.5s ease
z-index: 20
background: transparent
+ &.-resize-target
+ z-index: 1000
+
.grid--resizer
position: relative
height: $grid--widget-padding
diff --git a/frontend/src/app/modules/grids/grid/drag-and-drop.service.ts b/frontend/src/app/modules/grids/grid/drag-and-drop.service.ts
index 3099c9b2f17..7402ac5b894 100644
--- a/frontend/src/app/modules/grids/grid/drag-and-drop.service.ts
+++ b/frontend/src/app/modules/grids/grid/drag-and-drop.service.ts
@@ -43,6 +43,10 @@ export class GridDragAndDropService {
return this.currentlyDragging && this.draggedArea!.guid === area.guid;
}
+ public isPassive(area:GridWidgetArea) {
+ return this.currentlyDragging && !this.isDragged(area);
+ }
+
public get isDraggable() {
return this.layout.isEditable;
}
diff --git a/frontend/src/app/modules/grids/grid/grid.component.html b/frontend/src/app/modules/grids/grid/grid.component.html
index 673773d047f..82de28cc03d 100644
--- a/frontend/src/app/modules/grids/grid/grid.component.html
+++ b/frontend/src/app/modules/grids/grid/grid.component.html
@@ -6,7 +6,7 @@
<div *ngFor="let area of layout.widgetAreas; trackBy: identifyGridArea;"
class="grid--area -widgeted"
[ngClass]="{'-dragged': drag.isDragged(area),
- '-undragged': drag.currentlyDragging && !drag.isDragged(area)}"
+ '-passive': drag.isPassive(area) || resize.isPassive(area) }"
[style.grid-row-start]="area.gridStartRow"
[style.grid-row-end]="area.gridEndRow"
[style.grid-column-start]="area.gridStartColumn"
diff --git a/frontend/src/app/modules/grids/grid/resize.service.ts b/frontend/src/app/modules/grids/grid/resize.service.ts
index ee174c50170..1bae549baca 100644
--- a/frontend/src/app/modules/grids/grid/resize.service.ts
+++ b/frontend/src/app/modules/grids/grid/resize.service.ts
@@ -69,8 +69,16 @@ export class GridResizeService {
return this.placeholderArea && this.targetIds.includes(areaId);
}
+ public isResized(area:GridWidgetArea) {
+ return this.resizedArea && this.resizedArea.guid === area.guid;
+ }
+
+ public isPassive(area:GridWidgetArea) {
+ return this.currentlyResizing && !this.isResized(area);
+ }
+
public get currentlyResizing() {
- return this.placeholderArea;
+ return !!this.resizedArea;
}
public get isResizable() {