diff options
Diffstat (limited to 'tpl/objects/field-label.pug')
-rw-r--r-- | tpl/objects/field-label.pug | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tpl/objects/field-label.pug b/tpl/objects/field-label.pug index 151e084..fb96443 100644 --- a/tpl/objects/field-label.pug +++ b/tpl/objects/field-label.pug | |||
@@ -1,17 +1,18 @@ | |||
1 | mixin field-label(label, hint=null) | 1 | mixin field-label(label, hint=null) |
2 | - | 2 | - |
3 | let classes = { | 3 | let classes = { |
4 | 'o-field-label': true, | 4 | 'o-field-label': true, |
5 | 'o-field-label--left': attributes.align === 'left', | 5 | 'is-invalid': attributes.invalid, |
6 | 'o-field-label--right': attributes.align === 'right', | 6 | 'is-disabled': attributes.disabled, |
7 | 'is-invalid': attributes.invalid, | 7 | } |
8 | 'is-disabled': attributes.disabled, | 8 | if (attributes.align) { |
9 | classes['o-field-label--align-' + attributes.align] = true; | ||
9 | } | 10 | } |
10 | if (attributes.class) { | 11 | if (attributes.class) { |
11 | classes[attributes.class] = true; | 12 | classes[attributes.class] = true; |
12 | } | 13 | } |
13 | 14 | ||
14 | let needsLabelWidth = attributes.align === 'left' || attributes.align === 'right'; | 15 | let needsLabelWidth = !!attributes.align; |
15 | 16 | ||
16 | let labelStyle = needsLabelWidth ? 'width: ' + attributes.labelWidth : ''; | 17 | let labelStyle = needsLabelWidth ? 'width: ' + attributes.labelWidth : ''; |
17 | 18 | ||