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

display grid resizer only on hover

ulfertsddf08af31d05
diff --git a/app/assets/stylesheets/content/_grid.sass b/app/assets/stylesheets/content/_grid.sass
index 5600c421793..b39f5e86cb2 100644
--- a/app/assets/stylesheets/content/_grid.sass
+++ b/app/assets/stylesheets/content/_grid.sass
@@ -60,13 +60,6 @@ $grid--widget-padding: 20px
&.-column
width: $grid--gap-width
- .resizer
- margin-top: 0
- margin-left: auto
- margin-right: -$grid--widget-padding
- margin-bottom: -$grid--widget-padding
- position: relative
-
.cdk-drag-handle
cursor: grab
float: left
@@ -81,6 +74,19 @@ $grid--widget-padding: 20px
icon-triggered-context-menu
visibility: hidden
+.grid--resizer
+ margin-top: 0
+ margin-left: auto
+ margin-right: -$grid--widget-padding
+ margin-bottom: -$grid--widget-padding
+ position: relative
+ opacity: 0
+
+ .grid--area.-widgeted:hover &
+ opacity: 1
+ // only placed here to achieve precendence
+ border-bottom-color: $widget-box-block-border-color
+
.grid--area-drag-handle
margin-left: -19px
padding-right: 1px
diff --git a/frontend/src/app/modules/common/resizer/resizer.component.html b/frontend/src/app/modules/common/resizer/resizer.component.html
index 196c363be51..9f3b82c5b31 100644
--- a/frontend/src/app/modules/common/resizer/resizer.component.html
+++ b/frontend/src/app/modules/common/resizer/resizer.component.html
@@ -1,4 +1,5 @@
<div class="resizer"
+ [ngClass]="resizerClass"
*ngIf="!customHandler">
</div>
<ng-content></ng-content>
diff --git a/frontend/src/app/modules/common/resizer/resizer.component.ts b/frontend/src/app/modules/common/resizer/resizer.component.ts
index 3bfa4c43006..612ab34569f 100644
--- a/frontend/src/app/modules/common/resizer/resizer.component.ts
+++ b/frontend/src/app/modules/common/resizer/resizer.component.ts
@@ -31,6 +31,7 @@ export class ResizerComponent implements OnDestroy {
@Input() customHandler = false;
@Input() cursorClass = 'nwse-resize';
+ @Input() resizerClass = 'resizer';
ngOnDestroy() {
this.removeEventListener();
diff --git a/frontend/src/app/modules/grids/grid/grid.component.html b/frontend/src/app/modules/grids/grid/grid.component.html
index 57cedb2eb24..6c285508da6 100644
--- a/frontend/src/app/modules/grids/grid/grid.component.html
+++ b/frontend/src/app/modules/grids/grid/grid.component.html
@@ -33,6 +33,7 @@
</ndc-dynamic>
</div>
<resizer *ngIf="resize.isResizable"
+ [resizerClass]="'grid--resizer'"
(end)="resize.end(area, $event)"
(start)="resize.start(area)"
(move)="resize.moving($event)">
diff --git a/spec/support/components/grids/grid_area.rb b/spec/support/components/grids/grid_area.rb
index c9dff8227ab..11c0bc93c42 100644
--- a/spec/support/components/grids/grid_area.rb
+++ b/spec/support/components/grids/grid_area.rb
@@ -11,6 +11,7 @@ module Components
end
def resize_to(row, column)
+ area.hover
area.find('.resizer').drag_to self.class.of(row * 2, column * 2).area
end