Skip to content

Commit

Permalink
Merge pull request harvesthq#2106 from liorch88/optgroup-class-support
Browse files Browse the repository at this point in the history
Added support for optgroup classes inheritance
  • Loading branch information
stof committed Oct 15, 2014
2 parents 9e16aae + 46f513f commit 43141b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion coffee/lib/abstract-chosen.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ class AbstractChosen
return '' unless group.search_match || group.group_match
return '' unless group.active_options > 0

classes = []
classes.push "group-result"
classes.push group.classes if group.classes

group_el = document.createElement("li")
group_el.className = "group-result"
group_el.className = classes.join(" ")
group_el.innerHTML = group.search_text

this.outerHTML(group_el)
Expand Down
3 changes: 2 additions & 1 deletion coffee/lib/select-parser.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class SelectParser
group: true
label: this.escapeExpression(group.label)
children: 0
disabled: group.disabled
disabled: group.disabled,
classes: group.className
this.add_option( option, group_position, group.disabled ) for option in group.childNodes

add_option: (option, group_position, group_disabled) ->
Expand Down

0 comments on commit 43141b7

Please sign in to comment.