Skip to content

Bootstrap Modal correction #1329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions coffee/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ class Chosen extends AbstractChosen
finish_setup: ->
@form_field_jq.addClass "chzn-done"

container_width: ->
if @options.width?
return @options.width
else
if @form_field.offsetWidth is 0
return @form_field_jq.width() + "px"
else
return "#{@form_field.offsetWidth}px"

set_up_html: ->
@container_id = if @form_field.id.length then @form_field.id.replace(/[^\w]/g, '_') else this.generate_field_id()
@container_id += "_chzn"
Expand Down
10 changes: 10 additions & 0 deletions coffee/chosen.proto.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ class Chosen extends AbstractChosen
@multi_temp = new Template('<ul class="chzn-choices"><li class="search-field"><input type="text" value="#{default}" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop"><ul class="chzn-results"></ul></div>')
@no_results_temp = new Template('<li class="no-results">' + @results_none_found + ' "<span>#{terms}</span>"</li>')

container_width: ->
if @options.width?
return @options.width
else
if @form_field.offsetWidth is 0
return @form_field.getWidth() + "px"
else
return "#{@form_field.offsetWidth}px"


set_up_html: ->
@container_id = @form_field.identify().replace(/[^\w]/g, '_') + "_chzn"

Expand Down