Skip to content

Commit 2820684

Browse files
committed
Form: Add tr--has-key and tr--has-no-key classes
This helps styling rows with and without keys.
1 parent f799eae commit 2820684

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/elements/Form/SimpleForm.coffee

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,17 @@ class CUI.SimpleForm extends CUI.DataField
417417
classes.push("cui-form-field-type--input")
418418

419419
if table_has_left
420+
421+
lbl = get_label(field, true)
422+
if lbl
423+
classes.push("cui-form-tr--has-key")
424+
else
425+
classes.push("cui-form-tr--has-no-key")
426+
420427
tr = CUI.dom.element("DIV", class: "cui-form-tr "+classes.join(" "), "data-for-field": field.getUniqueId())
421428

422429
td = CUI.dom.element("DIV", class: "cui-form-td cui-form-key")
423-
append(get_label(field, true), td)
430+
append(lbl, td)
424431
tr.appendChild(td)
425432

426433
td = CUI.dom.element("DIV", class: "cui-form-td cui-form-value")

0 commit comments

Comments
 (0)