diff options
Diffstat (limited to 'tpl/objects/action-button.pug')
| -rw-r--r-- | tpl/objects/action-button.pug | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/tpl/objects/action-button.pug b/tpl/objects/action-button.pug index 0afe1ea..eb524a2 100644 --- a/tpl/objects/action-button.pug +++ b/tpl/objects/action-button.pug | |||
| @@ -1,21 +1,24 @@ | |||
| 1 | include icon.pug | 1 | include icon.pug |
| 2 | 2 | ||
| 3 | mixin action-button | 3 | mixin action-button |
| 4 | - | 4 | - |
| 5 | let classes = { | 5 | let classes = { |
| 6 | 'o-action-button': true, | 6 | 'o-action-button': true, |
| 7 | 'o-action-button--block': attributes.block, | 7 | 'o-action-button--block': attributes.block, |
| 8 | 'o-action-button--quiet': attributes.quiet, | 8 | 'o-action-button--quiet': attributes.quiet, |
| 9 | 'is-disabled': attributes.disabled, | 9 | 'is-disabled': attributes.disabled, |
| 10 | 'is-selected': attributes.selected | 10 | 'is-selected': attributes.selected |
| 11 | } | 11 | } |
| 12 | 12 | if (attributes.class) { | |
| 13 | let href = attributes.disabled ? null : '#'; | 13 | classes[attributes.class] = true; |
| 14 | } | ||
| 14 | 15 | ||
| 15 | a(class=classes href=href) | 16 | let href = attributes.disabled ? null : '#'; |
| 16 | if attributes.icon | 17 | |
| 17 | +icon(attributes.icon) | 18 | a(class=classes href=href) |
| 18 | = ' ' | 19 | if attributes.icon |
| 19 | if block | 20 | +icon(attributes.icon) |
| 20 | span.o-action-button__label | 21 | = ' ' |
| 21 | block | 22 | if block |
| 23 | span.o-action-button__label | ||
| 24 | block | ||
