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

[chore] introduced floating wrapper

Eric Schubert342be23be772
diff --git a/frontend/src/app/spot/spot-docs.component.html b/frontend/src/app/spot/spot-docs.component.html
index 346fe3c453d..18e72b2025b 100644
--- a/frontend/src/app/spot/spot-docs.component.html
+++ b/frontend/src/app/spot/spot-docs.component.html
@@ -133,9 +133,13 @@ Currently selected value is {{ toggleValue }}
</label>
</li>
<li class="spot-list--item">
- <label class="spot-list--item-action">
- <spot-checkbox [(ngModel)]="listCheckboxValue"></spot-checkbox>
- <div class="spot-list--item-title">Checkbox item with hover menu</div>
+ <div class="spot-list--item-floating-wrapper">
+ <!-- The floating wrapper enables correct hover effects, when the list items needs floating actions on hover.-->
+ <!-- Always wrap the content of the list item and the floating actions into the wrapper, but not any sub lists.-->
+ <label class="spot-list--item-action">
+ <spot-checkbox [(ngModel)]="listCheckboxValue"></spot-checkbox>
+ <div class="spot-list--item-title">Checkbox item with hover menu</div>
+ </label>
<div class="spot-list--item-floating-actions">
<button class="spot-link">
<span class="spot-icon spot-icon_folder-open"></span>
@@ -147,7 +151,7 @@ Currently selected value is {{ toggleValue }}
<span class="spot-icon spot-icon_file-doc"></span>
</button>
</div>
- </label>
+ </div>
</li>
<li class="spot-list--item">
<label class="spot-list--item-action">
@@ -156,15 +160,25 @@ Currently selected value is {{ toggleValue }}
</label>
<ul class="spot-list">
<li class="spot-list--item">
- <label class="spot-list--item-action">
- <spot-checkbox [(ngModel)]="listCheckboxValue"></spot-checkbox>
- <div class="spot-list--item-title">Child checkbox item</div>
- </label>
+ <div class="spot-list--item-floating-wrapper">
+ <label class="spot-list--item-action">
+ <spot-checkbox [(ngModel)]="listCheckboxValue"></spot-checkbox>
+ <div class="spot-list--item-title">Child checkbox item</div>
+ </label>
+ <div class="spot-list--item-floating-actions">
+ <button class="spot-link">
+ <span class="spot-icon spot-icon_folder-open"></span>
+ </button>
+ <button class="spot-link">
+ <span class="spot-icon spot-icon_file-doc"></span>
+ </button>
+ </div>
+ </div>
<ul class="spot-list">
<li class="spot-list--item">
<label class="spot-list--item-action">
<spot-checkbox [(ngModel)]="listCheckboxValue"></spot-checkbox>
- <div class="spot-list--item-title">Secon level child</div>
+ <div class="spot-list--item-title">Second level child</div>
</label>
</li>
</ul>
@@ -175,6 +189,22 @@ Currently selected value is {{ toggleValue }}
<div class="spot-list--item-title">Second child checkbox item</div>
</label>
</li>
+ <li class="spot-list--item">
+ <div class="spot-list--item-floating-wrapper">
+ <label class="spot-list--item-action">
+ <spot-checkbox [(ngModel)]="listCheckboxValue"></spot-checkbox>
+ <div class="spot-list--item-title">Second child checkbox item with hover menu</div>
+ </label>
+ <div class="spot-list--item-floating-actions">
+ <button class="spot-link">
+ <span class="spot-icon spot-icon_folder-open"></span>
+ </button>
+ <button class="spot-link">
+ <span class="spot-icon spot-icon_file-doc"></span>
+ </button>
+ </div>
+ </div>
+ </li>
<li class="spot-list--item">
<label class="spot-list--item-action spot-list--item-action_disabled">
<spot-checkbox
@@ -198,9 +228,13 @@ Currently selected value is {{ toggleValue }}
</label>
</li>
<li class="spot-list--item">
- <label class="spot-list--item-action">
- <spot-checkbox [(ngModel)]="listCheckboxValue"></spot-checkbox>
- <div class="spot-list--item-title">Checkbox item with hover menu</div>
+ <div class="spot-list--item-floating-wrapper">
+ <!-- The floating wrapper enables correct hover effects, when the list items needs floating actions on hover.-->
+ <!-- Always wrap the content of the list item and the floating actions into the wrapper, but not any sub lists.-->
+ <label class="spot-list--item-action">
+ <spot-checkbox [(ngModel)]="listCheckboxValue"></spot-checkbox>
+ <div class="spot-list--item-title">Checkbox item with hover menu</div>
+ </label>
<div class="spot-list--item-floating-actions">
<button class="spot-link">
<span class="spot-icon spot-icon_folder-open"></span>
@@ -212,7 +246,7 @@ Currently selected value is {{ toggleValue }}
<span class="spot-icon spot-icon_file-doc"></span>
</button>
</div>
- </label>
+ </div>
</li>
<li class="spot-list--item">
<label class="spot-list--item-action">
@@ -221,15 +255,25 @@ Currently selected value is {{ toggleValue }}
</label>
<ul class="spot-list spot-list_compact">
<li class="spot-list--item">
- <label class="spot-list--item-action">
- <spot-checkbox [(ngModel)]="listCheckboxValue"></spot-checkbox>
- <div class="spot-list--item-title">Child checkbox item</div>
- </label>
+ <div class="spot-list--item-floating-wrapper">
+ <label class="spot-list--item-action">
+ <spot-checkbox [(ngModel)]="listCheckboxValue"></spot-checkbox>
+ <div class="spot-list--item-title">Child checkbox item</div>
+ </label>
+ <div class="spot-list--item-floating-actions">
+ <button class="spot-link">
+ <span class="spot-icon spot-icon_folder-open"></span>
+ </button>
+ <button class="spot-link">
+ <span class="spot-icon spot-icon_file-doc"></span>
+ </button>
+ </div>
+ </div>
<ul class="spot-list spot-list_compact">
<li class="spot-list--item">
<label class="spot-list--item-action">
<spot-checkbox [(ngModel)]="listCheckboxValue"></spot-checkbox>
- <div class="spot-list--item-title">Secon level child</div>
+ <div class="spot-list--item-title">Second level child</div>
</label>
</li>
</ul>
@@ -240,6 +284,22 @@ Currently selected value is {{ toggleValue }}
<div class="spot-list--item-title">Second child checkbox item</div>
</label>
</li>
+ <li class="spot-list--item">
+ <div class="spot-list--item-floating-wrapper">
+ <label class="spot-list--item-action">
+ <spot-checkbox [(ngModel)]="listCheckboxValue"></spot-checkbox>
+ <div class="spot-list--item-title">Second child checkbox item with hover menu</div>
+ </label>
+ <div class="spot-list--item-floating-actions">
+ <button class="spot-link">
+ <span class="spot-icon spot-icon_folder-open"></span>
+ </button>
+ <button class="spot-link">
+ <span class="spot-icon spot-icon_file-doc"></span>
+ </button>
+ </div>
+ </div>
+ </li>
<li class="spot-list--item">
<label class="spot-list--item-action spot-list--item-action_disabled">
<spot-checkbox
diff --git a/frontend/src/app/spot/styles/sass/components/list.sass b/frontend/src/app/spot/styles/sass/components/list.sass
index f827e03e4cd..f2294ec9b07 100644
--- a/frontend/src/app/spot/styles/sass/components/list.sass
+++ b/frontend/src/app/spot/styles/sass/components/list.sass
@@ -13,9 +13,8 @@
&-action
@include spot-body-big
- position: relative
display: flex
- align-items: center
+ align-items: flex-start
justify-content: flex-start
padding: $spot-spacing-0_5 $spot-spacing-1
background-color: transparent
@@ -26,19 +25,25 @@
&:hover
background-color: $spot-color-basic-gray-6
- .spot-list--item-floating-actions
- opacity: 1
-
&_disabled
color: $spot-color-basic-gray-3
cursor: default
+ &-floating-wrapper
+ position: relative
+ display: flex
+
+ &:hover,
+ &:focus-within
+ background-color: $spot-color-basic-gray-6
+
&-floating-actions
opacity: 0
position: absolute
right: 0
- padding: inherit
- background: linear-gradient(90deg, rgba(243, 243, 243, 0) 0%, $spot-color-basic-gray-6 11.98%)
+ height: 100%
+ padding: $spot-spacing-0_5 $spot-spacing-1
+ background: linear-gradient(90deg, rgba($spot-color-basic-gray-6, 0) 0%, $spot-color-basic-gray-6 11.98%)
> .spot-link
&:not(:first-child)
@@ -49,16 +54,23 @@
&:not(:first-child)
margin-left: $spot-spacing-0_5
+
&:not(:last-child)
margin-left: $spot-spacing-0_5
+ &-floating-wrapper:hover > &-floating-actions,
+ &-floating-actions:focus-within,
+ &-floating-actions:hover
+ opacity: 1
+
&_compact &--item:not(:first-child)
margin-top: $spot-spacing-0_25
&--item > &_compact > &--item:first-child
margin-top: $spot-spacing-0_25
- &_compact &--item-action
+ &_compact &--item-action,
+ &_compact &--item-floating-actions
padding: $spot-spacing-0_25 $spot-spacing-1
$item-list: ""