auto_select2 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of auto_select2 might be problematic. Click here for more details.

data/README.md CHANGED
@@ -220,6 +220,27 @@ additional values. It construct from name and value of html-elements. Example:
220
220
  Here we initialize ajax select2 and during load select variants in `SearchAdapter` options hash
221
221
  appear key :token with value 'VUBJKB23UIVI1UU1VOBVI@'.
222
222
 
223
+ Moreover you may pass name of js function into additional_ajax_data:
224
+
225
+ additional_ajax_data: {selector: 'input.css-class',
226
+ function: 'additionalGlobalJsFunctionForRequestParameters'}
227
+
228
+ In this case function `additionalGlobalJsFunctionForRequestParameters` must looks follows:
229
+
230
+ window.additionalGlobalJsFunctionForRequestParameters = function($element, $term) {
231
+
232
+ // any js actions
233
+
234
+ return {
235
+ additional_param: '42',
236
+ awesome_option: 'something especial'
237
+ };
238
+ }
239
+
240
+ As you see, function receive two arguments: select2_element (i.e. initial input field) and
241
+ term (i.e. text from input). Return value of the function must be a hash. This hash merged into
242
+ ajax data and can be obtained in `SearchAdapter`.
243
+
223
244
  Third, in hash with items from search method exist additional optional parameter `class_name`.
224
245
  This parameter specify css-class for result element in select2. It useful for show different
225
246
  icons for different select variants.
@@ -1,3 +1,3 @@
1
1
  module AutoSelect2
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
@@ -15,6 +15,7 @@ jQuery ($) ->
15
15
  })
16
16
  return
17
17
  return
18
+ initAutoDataSelect2()
18
19
 
19
20
 
20
21
  $body = $('body')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto_select2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-10-16 00:00:00.000000000 Z
13
+ date: 2015-11-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: railties