Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ported performance fix to prototype

  • Loading branch information...
commit 61ec7098b9f53d972638045133ce2b2861cb326a 1 parent 2574e00
@kamal kamal authored committed
Showing with 1 addition and 2 deletions.
  1. +1 −2  coffee/chosen.proto.coffee
View
3  coffee/chosen.proto.coffee
@@ -404,8 +404,7 @@ class @Chosen extends AbstractChosen
selected = (option for option in @results_data when regex.test(option.value) and option.selected)
add_item_link = if selected.length == 0 then ' <a href="javascript:void(0);" class="option-add">Add this item</a>' else ''
@search_results.insert @no_results_temp.evaluate( terms: terms, add_item_link: add_item_link )
- if selected.length == 0
- @search_results.down("a.option-add").observe "click", (evt) => this.select_add_option(terms)
+ @search_results.down("a.option-add").observe "click", (evt) => this.select_add_option(terms) unless selected
select_add_option: (terms) ->
@form_field.insert @new_option_html.evaluate( terms: terms )
Please sign in to comment.
Something went wrong with that request. Please try again.