From 69d753931c098bc18cd23e96af18f736a772f416 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 22 Jun 2024 23:00:16 +0200 Subject: Update --- tpl/objects/field-label.pug | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tpl/objects/field-label.pug') 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 @@ mixin field-label(label, hint=null) - let classes = { - 'o-field-label': true, - 'o-field-label--left': attributes.align === 'left', - 'o-field-label--right': attributes.align === 'right', - 'is-invalid': attributes.invalid, - 'is-disabled': attributes.disabled, + 'o-field-label': true, + 'is-invalid': attributes.invalid, + 'is-disabled': attributes.disabled, + } + if (attributes.align) { + classes['o-field-label--align-' + attributes.align] = true; } if (attributes.class) { classes[attributes.class] = true; } - let needsLabelWidth = attributes.align === 'left' || attributes.align === 'right'; + let needsLabelWidth = !!attributes.align; let labelStyle = needsLabelWidth ? 'width: ' + attributes.labelWidth : ''; -- cgit v1.2.3-54-g00ecf