Skip to content

Commit 64a18ca

Browse files
author
Geert-Johan Riemer
committed
Add zebra colors
1 parent 50bb31d commit 64a18ca

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

form/form.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,12 @@ func BuildField(fileDescriptorSet *descriptor.FileDescriptorSet, msg *descriptor
524524
var oneofClick string
525525
if f.OneofIndex != nil {
526526
oneofClass += fmt.Sprintf("oneof-%d '+oneofDisabled(json['"+f.GetName()+"'])+'", *f.OneofIndex)
527+
if *f.OneofIndex%2 == 0 {
528+
oneofClass += " oneof-even"
529+
} else {
530+
oneofClass += " oneof-odd"
531+
}
532+
527533
action := fmt.Sprintf(`oneofSelect(this, \'oneof-%d\')`, *f.OneofIndex)
528534
oneofClick += `onClick="` + action + `" onFocusIn="` + action + `" onChange="` + action + `"`
529535
}
@@ -824,6 +830,12 @@ func CreateCustom(methodName, packageName, messageName string, g *generator.Gene
824830
.oneof-disabled input {
825831
background-color: grey;
826832
}
833+
.oneof-even > div {
834+
border-right: 5px solid red;
835+
}
836+
.oneof-odd > div {
837+
border-right: 5px solid blue;
838+
}
827839
828840
</style>
829841
`

0 commit comments

Comments
 (0)