active_scaffold 3.6.14 → 3.6.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +5 -0
- data/app/assets/javascripts/jquery/date_picker_bridge.js.erb +9 -0
- data/lib/active_scaffold/actions/nested.rb +3 -3
- data/lib/active_scaffold/bridges/date_picker/helper.rb +2 -4
- data/lib/active_scaffold/version.rb +1 -1
- data/vendor/assets/javascripts/jquery-ui-timepicker-addon.js +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cc7c6f7e057512476a4f93c0505622a34a97c81b6cbd75c5bb1b014a928ad65
|
4
|
+
data.tar.gz: c9e2bf9f2240b380b1ebd3f52007db921b88a3035aee3327fec779d74c43f0c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30377a392938156d9ce545bf18fe0cafebabd935fcd913d4ad28836f53a25cbde41bb7849542f08d6acebdcab9d0e39c8efbddc2d0fe10bf4a40c8af4cedf15e
|
7
|
+
data.tar.gz: 19602b41999bf34152f9a968c78aa36529794ca7d5ae17db43c55ae288f34b5ed5409923cd1e62ec7a8f5d97f781dd60cce8307c90291136303c3890e0c543e4
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
= 3.6.15
|
2
|
+
- Prevent firing 2 change events on jquery datetime pickers
|
3
|
+
- Fix setting data options on columns for date and datetime pickers
|
4
|
+
|
5
|
+
= 3.6.14
|
1
6
|
- Fix setting data on html_options when threadsafe is enabled
|
2
7
|
- Fill nested association on render field, as done in new action
|
3
8
|
|
@@ -41,3 +41,12 @@ jQuery(document).on("focus", "input.datetime_picker", function(){
|
|
41
41
|
}
|
42
42
|
return true;
|
43
43
|
});
|
44
|
+
|
45
|
+
jQuery(document).on('change', 'input.datetime_picker', function(e) {
|
46
|
+
var $this = $(this);
|
47
|
+
if ($this.data('first-event')) $this.removeData('first-event');
|
48
|
+
else {
|
49
|
+
$this.data('first-event', true);
|
50
|
+
e.stopImmediatePropagation();
|
51
|
+
}
|
52
|
+
});
|
@@ -118,15 +118,15 @@ module ActiveScaffold::Actions
|
|
118
118
|
@nested_parent_record ||= find_if_allowed(nested.parent_id, crud, nested.parent_model)
|
119
119
|
end
|
120
120
|
|
121
|
-
def create_association_with_parent?
|
121
|
+
def create_association_with_parent?(check_match = false)
|
122
122
|
# has_many is done by beginning_of_chain and rails if direct association, not in through associations
|
123
123
|
return false if nested.has_many? && !nested.association.through?
|
124
|
+
return false if check_match && !nested.match_model?(active_scaffold_config.model)
|
124
125
|
nested.child_association && nested_parent_record
|
125
126
|
end
|
126
127
|
|
127
128
|
def create_association_with_parent(record, check_match = false)
|
128
|
-
return unless create_association_with_parent?
|
129
|
-
return if check_match && !nested.match_model?(active_scaffold_config.model)
|
129
|
+
return unless create_association_with_parent?(check_match)
|
130
130
|
if nested.child_association.singular?
|
131
131
|
record.send("#{nested.child_association.name}=", nested_parent_record)
|
132
132
|
elsif nested.association.through_singular? && nested.child_association.through_singular?
|
@@ -160,8 +160,7 @@ module ActiveScaffold::Bridges
|
|
160
160
|
format = datepicker_format(options, column.search_ui)
|
161
161
|
options[:class] << " #{column.search_ui}"
|
162
162
|
options[:style] = 'display: none' if options[:show] == false # hide only if asked to hide
|
163
|
-
options[:data]
|
164
|
-
options[:data].merge! datepicker_format_options(column, format)
|
163
|
+
options[:data] = datepicker_format_options(column, format).reverse_merge!(options[:data] || {})
|
165
164
|
value = l(value, :format => format) if value
|
166
165
|
options = options.merge(:id => "#{options[:id]}_#{name}", :name => "#{options[:name]}[#{name}]", :object => nil)
|
167
166
|
text_field_tag("#{options[:name]}[#{name}]", value, options)
|
@@ -176,8 +175,7 @@ module ActiveScaffold::Bridges
|
|
176
175
|
|
177
176
|
format = datepicker_format(options, column.form_ui)
|
178
177
|
value = controller.class.condition_value_for_datetime(column, record.send(column.name), column.form_ui == :date_picker ? :to_date : :to_time)
|
179
|
-
options[:data]
|
180
|
-
options[:data].merge! datepicker_format_options(column, format)
|
178
|
+
options[:data] = datepicker_format_options(column, format).reverse_merge!(options[:data] || {})
|
181
179
|
options[:value] = (value ? l(value, :format => format) : nil)
|
182
180
|
text_field(:record, column.name, options)
|
183
181
|
end
|
@@ -174,8 +174,8 @@
|
|
174
174
|
|
175
175
|
for (var attrName in this._defaults) {
|
176
176
|
if (this._defaults.hasOwnProperty(attrName)) {
|
177
|
-
var attrValue = $input.
|
178
|
-
if (attrValue) {
|
177
|
+
var attrValue = $input.data(attrName.toLowerCase());
|
178
|
+
if (attrValue !== undefined) {
|
179
179
|
try {
|
180
180
|
inlineSettings[attrName] = eval(attrValue);
|
181
181
|
} catch (err) {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.
|
4
|
+
version: 3.6.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Many, see README
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|