activeadmin_addons 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1110538781573fbe7162c64b28bfcb58018505c4
|
4
|
+
data.tar.gz: 51fad730b2eb10c3c0c1dc810813556abe53d52f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0024e1722cb4a43d3a918e34dc22e8f12a3576ed5db1f626b9972ebb8a5cf67175a5e3ac4541096efb8af558df689b787aabe257fe92057a252b66e3f8d2900d
|
7
|
+
data.tar.gz: d0de9005c672a8a642830b91a389163231e3c3f1c2d529e4f00e955e23c12d7bbb54c87fa87ccf46a3f06ab2bc422295b24bde870f1ebab8c40f1cafaac0f33f
|
@@ -3,70 +3,76 @@
|
|
3
3
|
|
4
4
|
$(function() {
|
5
5
|
|
6
|
-
|
7
|
-
$(el).select2({
|
8
|
-
width: '80%',
|
9
|
-
tags: $(el).data('collection')
|
10
|
-
});
|
11
|
-
});
|
6
|
+
setupSelect2();
|
12
7
|
|
13
|
-
$('
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
});
|
18
|
-
} else {
|
8
|
+
$(document).on('has_many_add:after', setupSelect2);
|
9
|
+
|
10
|
+
function setupSelect2() {
|
11
|
+
$('.select2-tags').each(function(i, el) {
|
19
12
|
$(el).select2({
|
20
|
-
width: '80%'
|
13
|
+
width: '80%',
|
14
|
+
tags: $(el).data('collection')
|
21
15
|
});
|
22
|
-
}
|
23
|
-
});
|
24
|
-
|
25
|
-
$('.select2-ajax').each(function(i, el) {
|
26
|
-
var url = $(el).data('url');
|
27
|
-
var fields = $(el).data('fields');
|
28
|
-
var displayName = $(el).data('display_name');
|
29
|
-
var order = fields[0] + "_desc";
|
16
|
+
});
|
30
17
|
|
31
|
-
$(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
var text = $(element).data("selected") || "";
|
36
|
-
callback({
|
37
|
-
id: id,
|
38
|
-
text: text
|
18
|
+
$('select:not(.default-select)').each(function(i, el) {
|
19
|
+
if ($(el).closest('.filter_form').length > 0) {
|
20
|
+
$(el).select2({
|
21
|
+
width: 'resolve'
|
39
22
|
});
|
40
|
-
}
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
var query = {m: "or"};
|
47
|
-
fields.forEach(function(field) {
|
48
|
-
query[field + "_contains"] = term;
|
49
|
-
});
|
23
|
+
} else {
|
24
|
+
$(el).select2({
|
25
|
+
width: '80%'
|
26
|
+
});
|
27
|
+
}
|
28
|
+
});
|
50
29
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
30
|
+
$('.select2-ajax').each(function(i, el) {
|
31
|
+
var url = $(el).data('url');
|
32
|
+
var fields = $(el).data('fields');
|
33
|
+
var displayName = $(el).data('display_name');
|
34
|
+
var order = fields[0] + "_desc";
|
35
|
+
|
36
|
+
$(el).select2({
|
37
|
+
width: '80%',
|
38
|
+
initSelection: function(element, callback) {
|
39
|
+
var id = $(element).val();
|
40
|
+
var text = $(element).data("selected") || "";
|
41
|
+
callback({
|
42
|
+
id: id,
|
43
|
+
text: text
|
44
|
+
});
|
55
45
|
},
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
46
|
+
ajax: {
|
47
|
+
url: url,
|
48
|
+
dataType: 'json',
|
49
|
+
delay: 250,
|
50
|
+
data: function (term) {
|
51
|
+
var query = {m: "or"};
|
52
|
+
fields.forEach(function(field) {
|
53
|
+
query[field + "_contains"] = term;
|
54
|
+
});
|
55
|
+
|
56
|
+
return {
|
57
|
+
order: order,
|
58
|
+
q: query
|
59
|
+
};
|
60
|
+
},
|
61
|
+
results: function (data, page) {
|
62
|
+
return {
|
63
|
+
results: jQuery.map(data, function(resource) {
|
64
|
+
return {
|
65
|
+
id: resource.id,
|
66
|
+
text: resource[displayName]
|
67
|
+
};
|
68
|
+
})
|
69
|
+
};
|
70
|
+
},
|
71
|
+
cache: true
|
65
72
|
},
|
66
|
-
|
67
|
-
}
|
68
|
-
minimumInputLength: 1
|
73
|
+
minimumInputLength: 1
|
74
|
+
});
|
69
75
|
});
|
70
|
-
}
|
76
|
+
}
|
71
77
|
|
72
78
|
});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin_addons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platanus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -101,6 +101,8 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
+
- MIT-LICENSE
|
105
|
+
- Rakefile
|
104
106
|
- app/assets/images/fileicons/file_extension_3gp.png
|
105
107
|
- app/assets/images/fileicons/file_extension_7z.png
|
106
108
|
- app/assets/images/fileicons/file_extension_ace.png
|
@@ -209,6 +211,7 @@ files:
|
|
209
211
|
- app/assets/stylesheets/activeadmin_addons/all.css.scss
|
210
212
|
- app/inputs/search_select_input.rb
|
211
213
|
- app/inputs/tags_input.rb
|
214
|
+
- lib/activeadmin_addons.rb
|
212
215
|
- lib/activeadmin_addons/addons/bool_values.rb
|
213
216
|
- lib/activeadmin_addons/addons/enum_tag.rb
|
214
217
|
- lib/activeadmin_addons/addons/list.rb
|
@@ -220,10 +223,7 @@ files:
|
|
220
223
|
- lib/activeadmin_addons/support/enumerize_formtastic_support.rb
|
221
224
|
- lib/activeadmin_addons/support/set_datepicker.rb
|
222
225
|
- lib/activeadmin_addons/version.rb
|
223
|
-
- lib/activeadmin_addons.rb
|
224
226
|
- lib/tasks/activeadmin_addons_tasks.rake
|
225
|
-
- MIT-LICENSE
|
226
|
-
- Rakefile
|
227
227
|
homepage: https://github.com/platanus/activeadmin_addons
|
228
228
|
licenses:
|
229
229
|
- MIT
|
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
244
|
version: '0'
|
245
245
|
requirements: []
|
246
246
|
rubyforge_project:
|
247
|
-
rubygems_version: 2.
|
247
|
+
rubygems_version: 2.4.8
|
248
248
|
signing_key:
|
249
249
|
specification_version: 4
|
250
250
|
summary: Set of addons to help with the activeadmin ui
|