Skip to content

Commit

Permalink
Allow to show menu title for single Action
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
  • Loading branch information
raimund-schluessler committed Jan 4, 2022
1 parent 9987ad1 commit ccf9e3a
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions src/components/Actions/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ export default {
v-bind="firstActionBinding"
:class="{
[firstAction.icon]: firstAction.icon,
[firstActionClass]: firstActionClass }"
[firstActionClass]: firstActionClass,
'action-item--single--with-title': menuTitle }"
class="action-item action-item--single"
rel="nofollow noreferrer noopener"
:disabled="isDisabled"
Expand All @@ -148,6 +149,8 @@ export default {
<!-- Render the icon slot content of the first action -->
<VNodes :vnodes="firstActionIconSlot" />

{{ menuTitle }}

<!-- fake slot to gather main action -->
<span :aria-hidden="true" hidden>
<!-- @slot All action elements passed into the default slot will be used -->
Expand Down Expand Up @@ -683,27 +686,6 @@ export default {
border: none;
border-radius: $clickable-area / 2;
background-color: transparent;
}
&::v-deep .material-design-icon {
width: $clickable-area;
height: $clickable-area;
opacity: $opacity_full;
.material-design-icon__svg {
vertical-align: middle;
}
}
// icon-more
&__menutoggle {
// align menu icon in center
display: flex;
align-items: center;
justify-content: center;
opacity: $opacity_normal;
font-weight: bold;
line-height: $icon-size;
&--with-title {
position: relative;
Expand All @@ -728,6 +710,27 @@ export default {
left: ($clickable-area - 24px) / 2;
}
}
}
&::v-deep .material-design-icon {
width: $clickable-area;
height: $clickable-area;
opacity: $opacity_full;
.material-design-icon__svg {
vertical-align: middle;
}
}
// icon-more
&__menutoggle {
// align menu icon in center
display: flex;
align-items: center;
justify-content: center;
opacity: $opacity_normal;
font-weight: bold;
line-height: $icon-size;
&--primary {
opacity: $opacity_full;
Expand Down

0 comments on commit ccf9e3a

Please sign in to comment.