Skip to content

Commit

Permalink
use library specifics
Browse files Browse the repository at this point in the history
  • Loading branch information
koenpunt committed Oct 21, 2016
1 parent 7131c5f commit 68d82ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
10 changes: 2 additions & 8 deletions coffee/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,8 @@ class Chosen extends AbstractChosen
@form_field_jq.show()

search_field_disabled: ->
@is_disabled = @form_field.disabled || (=>
element = @form_field
disabled = false
while (element = element.parentElement) && element != element.ownerDocument
disabled = element.nodeName.toUpperCase() == 'FIELDSET' && element.disabled
break if disabled
disabled
)()
@is_disabled = @form_field.disabled || @form_field_jq.parents('fieldset').is(':disabled')

@container.toggleClass 'chosen-disabled', @is_disabled
@search_field[0].disabled = @is_disabled

Expand Down
9 changes: 1 addition & 8 deletions coffee/chosen.proto.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,7 @@ class @Chosen extends AbstractChosen
@form_field.show()

search_field_disabled: ->
@is_disabled = @form_field.disabled || (=>
element = @form_field
disabled = false
while (element = element.parentElement) && element != element.ownerDocument
disabled = element.nodeName.toUpperCase() == 'FIELDSET' && element.disabled
break if disabled
disabled
)()
@is_disabled = @form_field.disabled || @form_field.up('fieldset')?.disabled || false

if @is_disabled
@container.addClassName 'chosen-disabled'
Expand Down

0 comments on commit 68d82ca

Please sign in to comment.