From f97c91f7ec4afc26ab790fbefa63d11b3060f40f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 21 Nov 2018 17:05:31 +0100 Subject: Add separators in user moderation dropdown --- .../shared/buttons/action-dropdown.component.html | 20 +++++++++++++------- .../shared/buttons/action-dropdown.component.scss | 6 +++++- .../app/shared/buttons/action-dropdown.component.ts | 8 +++++++- 3 files changed, 25 insertions(+), 9 deletions(-) (limited to 'client/src/app/shared/buttons') diff --git a/client/src/app/shared/buttons/action-dropdown.component.html b/client/src/app/shared/buttons/action-dropdown.component.html index 48230d6d8..90651f217 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.html +++ b/client/src/app/shared/buttons/action-dropdown.component.html @@ -8,14 +8,20 @@ - \ No newline at end of file + diff --git a/client/src/app/shared/buttons/action-dropdown.component.scss b/client/src/app/shared/buttons/action-dropdown.component.scss index 92c4d1d2c..a4fcceeee 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.scss +++ b/client/src/app/shared/buttons/action-dropdown.component.scss @@ -1,6 +1,10 @@ @import '_variables'; @import '_mixins'; +.dropdown-divider:last-child { + display: none; +} + .action-button { @include peertube-button; @@ -52,4 +56,4 @@ width: 100%; } } -} \ No newline at end of file +} diff --git a/client/src/app/shared/buttons/action-dropdown.component.ts b/client/src/app/shared/buttons/action-dropdown.component.ts index d8026ef41..275e2b51e 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.ts +++ b/client/src/app/shared/buttons/action-dropdown.component.ts @@ -14,10 +14,16 @@ export type DropdownAction = { }) export class ActionDropdownComponent { - @Input() actions: DropdownAction[] = [] + @Input() actions: DropdownAction[] | DropdownAction[][] = [] @Input() entry: T @Input() placement = 'bottom-left' @Input() buttonSize: 'normal' | 'small' = 'normal' @Input() label: string @Input() theme: 'orange' | 'grey' = 'grey' + + getActions () { + if (this.actions.length !== 0 && Array.isArray(this.actions[0])) return this.actions + + return [ this.actions ] + } } -- cgit v1.2.3