rails3-jquery-autocomplete 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -182,6 +182,10 @@ And then, install all your dependencies:
182
182
  ## Running the test suite
183
183
 
184
184
  rake test
185
+
186
+ # Changelog
187
+
188
+ * 0.3.6 Using .live() to put autocomplete on dynamic fields
185
189
 
186
190
  # About the Author
187
191
 
@@ -1,4 +1,5 @@
1
1
  Given /^I choose "([^"]*)" in the autocomplete list$/ do |text|
2
+ page.execute_script %Q{ $('input[data-autocomplete]').trigger("focus") }
2
3
  page.execute_script %Q{ $('input[data-autocomplete]').trigger("keydown") }
3
4
  sleep 1
4
5
  page.execute_script %Q{ $('.ui-menu-item a:contains("#{text}")').trigger("mouseenter").trigger("click"); }
@@ -5,17 +5,17 @@
5
5
  * with the autocomplete URL as the value
6
6
  *
7
7
  * Example:
8
- * <input type="text" autocomplete="/url/to/autocomplete">
8
+ * <input type="text" data-autocomplete="/url/to/autocomplete">
9
9
  *
10
10
  * Optionally, you can use a jQuery selector to specify a field that can
11
11
  * be updated with the element id whenever you find a matching value
12
12
  *
13
13
  * Example:
14
- * <input type="text" autocomplete="/url/to/autocomplete" id_element="#id_field">
14
+ * <input type="text" data-autocomplete="/url/to/autocomplete" id_element="#id_field">
15
15
  */
16
16
 
17
17
  $(document).ready(function(){
18
- $('input[data-autocomplete]').each(function(i){
18
+ $('input[data-autocomplete]').live('focus', function(i){
19
19
  $(this).autocomplete({
20
20
  source: $(this).attr('data-autocomplete'),
21
21
  select: function(event, ui) {
@@ -27,4 +27,4 @@ $(document).ready(function(){
27
27
  }
28
28
  });
29
29
  });
30
- });
30
+ });
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails3-jquery-autocomplete
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 5
10
- version: 0.3.5
9
+ - 6
10
+ version: 0.3.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Padilla
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-27 00:00:00 -07:00
18
+ date: 2010-10-12 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency