activeadmin_addons 0.6.3 → 0.6.4

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: be51336ce2e813dc88bab132ae56d6c4319a7a29
4
- data.tar.gz: ad07b4928bfee859f4b890af2ef2d33e376db89f
3
+ metadata.gz: 6d435121eb4c55a5255387dd87b0925f82893fa1
4
+ data.tar.gz: 88921f3c132692be19b644bfe5d8b9cf9eb26289
5
5
  SHA512:
6
- metadata.gz: 63065e5b7219f832b063ff2d7180101d3c089d5d7ce33dc56da27913ffde858e9ef7eb932b22026bb75fb571b6c35609c493dbdb396c502a7104ca1c0f7aeb49
7
- data.tar.gz: 63f64c3067bd5bac8bfa200369867e182cc98a11892b2dbd2c9a05336c462764a879f22961fd3d77069920842aa44e0491579fc4112d5719b39200261ee998ab
6
+ metadata.gz: 43e3d2ada63e439b53a0e6b785e1d275a821ae8000362e6823a8a5f34b4f7728d244f20a113b13266a9ec8cebc84748c9b9bce4af0e27f523735c95aa3d6c752
7
+ data.tar.gz: d15d77617e7c57f0037d8c3db605dfa5a2d689fcfaab749740a8904498f077b88cb245d62ff506e9999bb079a98ad94c99fc2215142777a7c4a185223007fca9
@@ -3,21 +3,23 @@
3
3
 
4
4
  $(function() {
5
5
 
6
- setupSelect2();
6
+ setupSelect2(document);
7
7
 
8
- $(document).on('has_many_add:after', setupSelect2);
8
+ $(document).on('has_many_add:after', function(event, container){
9
+ setupSelect2(container);
10
+ });
9
11
 
10
- function setupSelect2() {
12
+ function setupSelect2(container) {
11
13
  var INVALID_PARENT_ID = -1;
12
14
 
13
- $('.select2-tags').each(function(i, el) {
15
+ $('.select2-tags', container).each(function(i, el) {
14
16
  $(el).select2({
15
17
  width: '80%',
16
18
  tags: $(el).data('collection')
17
19
  });
18
20
  });
19
21
 
20
- $('select:not(.default-select)').each(function(i, el) {
22
+ $('select:not(.default-select)', container).each(function(i, el) {
21
23
  if ($(el).closest('.filter_form').length > 0) {
22
24
  $(el).select2({
23
25
  width: 'resolve'
@@ -30,7 +32,7 @@ $(function() {
30
32
  });
31
33
 
32
34
 
33
- $('.select2-ajax').each(function(i, el) {
35
+ $('.select2-ajax', container).each(function(i, el) {
34
36
  var url = $(el).data('url');
35
37
  var fields = $(el).data('fields');
36
38
  var displayName = $(el).data('display_name');
@@ -3,6 +3,8 @@ class ListBuilder < ActiveAdminAddons::CustomBuilder
3
3
  options[:localize] = options.fetch(:localize, false)
4
4
  options[:list_type] = options.fetch(:list_type, :ul)
5
5
 
6
+ return if data.nil?
7
+
6
8
  raise 'invalid list type (ul, ol)' unless [:ul, :ol].include?(options[:list_type])
7
9
  raise "list must be Array or Hash" if !data.is_a?(Hash) && !data.is_a?(Array)
8
10
 
@@ -1,3 +1,3 @@
1
1
  module ActiveadminAddons
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
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.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platanus
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-01 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties