Skip to content

Commit

Permalink
Add zebra colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Geert-Johan Riemer committed Nov 18, 2015
1 parent 01ad87f commit d696d53
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions form/form.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,12 @@ func BuildField(fileDescriptorSet *descriptor.FileDescriptorSet, msg *descriptor
var oneofClick string
if f.OneofIndex != nil {
oneofClass += fmt.Sprintf("oneof-%d '+oneofDisabled(json['"+f.GetName()+"'])+'", *f.OneofIndex)
if *f.OneofIndex%2 == 0 {
oneofClass += " oneof-even"
} else {
oneofClass += " oneof-odd"
}

action := fmt.Sprintf(`oneofSelect(this, \'oneof-%d\')`, *f.OneofIndex)
oneofClick += `onClick="` + action + `" onFocusIn="` + action + `" onChange="` + action + `"`
}
Expand Down Expand Up @@ -824,6 +830,12 @@ func CreateCustom(methodName, packageName, messageName string, g *generator.Gene
.oneof-disabled input {
background-color: grey;
}
.oneof-even > div {
border-right: 5px solid red;
}
.oneof-odd > div {
border-right: 5px solid blue;
}
</style>
`
Expand Down

0 comments on commit d696d53

Please sign in to comment.