visual_condition_builder 2.1.6 → 2.2.0
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: 1af2cb5d937b9857357b882cd71845d480bd4eab
|
4
|
+
data.tar.gz: 905d1f6ecb357906d67e3372444fc654da04125b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 560146be3d2b940d6d56504b787e0f442c43e8cd4cdddf2e92ab2dfdb38694affebdc96bda35f0abbb33d41a4f9184c22c939c05bc0d0c61ea03606a6841fa78
|
7
|
+
data.tar.gz: 95cf175b786168e48ae2405c10752c924da653be1639ccc05f0cea08df1706400e7dff57a122a288c394687a4d8199e58622f1d262738014f5c6df9ef3ef31ce
|
data/README.md
CHANGED
@@ -101,7 +101,8 @@ operators | Defines which operators you want to use, if not informed, the defaul
|
|
101
101
|
values | Sets the default values for this field, restricting the user to those values.
|
102
102
|
group | Creates a separation in the field list by grouping the fields with this group
|
103
103
|
|
104
|
-
By default, the condition builder implements some operators and arguments, allowing you to enter only the operator name, like: `operators: [:eq, :between]`
|
104
|
+
By default, the condition builder implements some operators and arguments, allowing you to enter only the operator name, like: `operators: [:eq, :between]`
|
105
|
+
You can also inform `operators: []` to hide operator's box.
|
105
106
|
|
106
107
|
List of default operators:
|
107
108
|
|
@@ -114,10 +114,13 @@
|
|
114
114
|
var op_option = $('<option data-index="' + op_i + '" data-no-value="' + op_el.no_value + '" data-multiple="' + op_el.multiple + '" value="' + op_el.operator + '">' + getLabel(op_el) + '</option>');
|
115
115
|
$operators.append(op_option);
|
116
116
|
});
|
117
|
-
|
117
|
+
|
118
|
+
if (operators.length > 1) {
|
119
|
+
$operators.removeClass('hide');
|
120
|
+
} else if (operators.length == 1) {
|
118
121
|
$fixedOperator.html(getLabel(operators[0])).removeClass('hide');
|
119
122
|
} else {
|
120
|
-
|
123
|
+
//NONE
|
121
124
|
}
|
122
125
|
$operators.trigger('change');
|
123
126
|
};
|
@@ -40,7 +40,7 @@ module VisualConditionBuilder
|
|
40
40
|
args = array_hashes_to_hash(args)
|
41
41
|
attr_param = attr.to_s.gsub(/\./,'_')
|
42
42
|
args[:type] ||= 'STRING'
|
43
|
-
args[:operators] = operators_by_type(args[:type])
|
43
|
+
args[:operators] = operators_by_type(args[:type]) if args.dig(:operators).nil?
|
44
44
|
args[:operators] = normalize_operators(args[:operators])
|
45
45
|
args[:values] ||= []
|
46
46
|
args[:group] ||= ''
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: visual_condition_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno Porto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|