Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merging changes in from @philBrown

  • Loading branch information...
commit 0483c93edb39ff87695020631df54de479a5c7b7 1 parent 753a677
@pfiller pfiller authored
View
1  .gitignore
@@ -1,2 +1,3 @@
.DS_Store
node_modules
+.project
View
3  coffee/chosen.jquery.coffee
@@ -385,7 +385,8 @@ class Chosen extends AbstractChosen
results = 0
searchText = if @search_field.val() is @default_text then "" else $('<div/>').text($.trim(@search_field.val())).html()
- regex = new RegExp('^' + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i')
+ regexAnchor = if @options.search_contains then "" else "^"
+ regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i')
zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i')
for option in @results_data
View
3  coffee/chosen.proto.coffee
@@ -376,7 +376,8 @@ class Chosen extends AbstractChosen
results = 0
searchText = if @search_field.value is @default_text then "" else @search_field.value.strip().escapeHTML()
- regex = new RegExp('^' + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i')
+ regexAnchor = if @options.search_contains then "" else "^"
+ regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i')
zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i')
for option in @results_data
Please sign in to comment.
Something went wrong with that request. Please try again.