active_scaffold 3.4.23 → 3.4.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +7 -0
- data/app/assets/javascripts/jquery/active_scaffold.js +8 -2
- data/app/views/active_scaffold_overrides/_field_search.html.erb +13 -9
- data/app/views/active_scaffold_overrides/_search.html.erb +15 -11
- data/lib/active_scaffold/bridges/record_select/helpers.rb +1 -1
- data/lib/active_scaffold/helpers/search_column_helpers.rb +1 -1
- data/lib/active_scaffold/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc9178690751a9ba0c8d602ed0d2e133dcb42d67
|
4
|
+
data.tar.gz: 9a27c060e1b4953701409cc4c550b15cfe48f428
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 483dd99adb6c1f300474b5eecb0ae5377428d901896d79889b205525ba37691afe7781e6854300d6acfdd635d4cf3220afdf008a19e120ea7df89bc4d9426760
|
7
|
+
data.tar.gz: b32f74e9882bc164bf6b42f613e0106dd21dc1df54eada67234198834fbc881b0f357c3af50ca1993a5462cfd3bad7fca31c897cb78a3d8bdc490044e22547ef
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
= 3.4.24
|
2
|
+
- allow to set :controller in active_scaffold_record_select_autocomplete parameter or active_scaffold_input_text_options
|
3
|
+
- fix keeping focus after update_columns when focus was changed to a field which is going to be updated
|
4
|
+
- no autofocus first input if is inside .no-autofocus tag
|
5
|
+
- use active_scaffold_enum_options on select search_ui
|
6
|
+
- add submit_text option for field_search and search partials
|
7
|
+
|
1
8
|
= 3.4.23
|
2
9
|
- fix chosen on new subform rows
|
3
10
|
- add show_ui to column
|
@@ -612,7 +612,9 @@ var ActiveScaffold = {
|
|
612
612
|
focus_first_element_of_form: function(form_element, form_selector) {
|
613
613
|
if (typeof(form_element) == 'string') form_element = '#' + form_element;
|
614
614
|
if (typeof(form_selector) == 'undefined') form_selector = jQuery(form_element).is('form') ? '' : 'form ';
|
615
|
-
var input = jQuery(form_selector + ":input:visible:first", jQuery(form_element))
|
615
|
+
var input = jQuery(form_selector + ":input:visible:first", jQuery(form_element));
|
616
|
+
if (input.is('.no-autofocus :input')) return;
|
617
|
+
input.focus();
|
616
618
|
try { if (input[0] && input[0].value) input[0].selectionStart = input[0].selectionEnd = input[0].value.length; } catch(e) {}
|
617
619
|
},
|
618
620
|
|
@@ -972,7 +974,11 @@ var ActiveScaffold = {
|
|
972
974
|
element = as_form.find('#'+element.attr('id'));
|
973
975
|
element.nextAll('img.loading-indicator').css('visibility','hidden');
|
974
976
|
element.trigger('ajax:complete', [xhr, status]);
|
975
|
-
if (ActiveScaffold.last_focus)
|
977
|
+
if (ActiveScaffold.last_focus) {
|
978
|
+
var item = jQuery(ActiveScaffold.last_focus);
|
979
|
+
if (item.closest('body').length == 0 && item.attr('id')) item = jQuery('#' + item.attr('id'));
|
980
|
+
item.focus().select();
|
981
|
+
}
|
976
982
|
},
|
977
983
|
error: function (xhr, status, error) {
|
978
984
|
element = as_form.find('#'+element.attr('id'));
|
@@ -1,11 +1,15 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
<%
|
2
|
+
url_options ||= params_for(:action => :index, :search => nil)
|
3
|
+
submit_text ||= :search
|
4
|
+
options = {
|
5
|
+
:id => element_form_id(:action => 'search'),
|
6
|
+
:class => "as_form search",
|
7
|
+
:remote => xhr ||= request.xhr?,
|
8
|
+
:method => :get,
|
9
|
+
:'data-loading' => true
|
10
|
+
}
|
11
|
+
-%>
|
12
|
+
<%= form_tag url_options, options %>
|
9
13
|
<ol class="form">
|
10
14
|
<% visibles, hiddens = visibles_and_hiddens(active_scaffold_config.field_search) %>
|
11
15
|
<% visibles.each do |column| -%>
|
@@ -27,7 +31,7 @@ form_tag url_options, options %>
|
|
27
31
|
<% end -%>
|
28
32
|
</ol>
|
29
33
|
<p class="form-footer">
|
30
|
-
<%= submit_tag as_(
|
34
|
+
<%= submit_tag as_(submit_text), :class => "submit" %>
|
31
35
|
<%= link_to as_(:reset), url_for(url_options.merge(:search => '')), :class => 'as_cancel reset', :remote => true, :data => {:refresh => true} unless local_assigns[:skip_reset] %>
|
32
36
|
<%= loading_indicator_tag(:action => :search) %>
|
33
37
|
</p>
|
@@ -1,14 +1,18 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
<%
|
2
|
+
live_search = active_scaffold_config.search.live?
|
3
|
+
url_options = params_for(:action => :index).delete_if{|k,v| k == 'search'}
|
4
|
+
submit_text ||= :search
|
5
|
+
options = {
|
6
|
+
:id => element_form_id(:action => 'search'),
|
7
|
+
:class => "as_form search#{' live' if live_search}",
|
8
|
+
:remote => xhr ||= request.xhr?,
|
9
|
+
:'data-loading' => true,
|
10
|
+
:method => :get
|
11
|
+
}
|
12
|
+
-%>
|
13
|
+
<%= form_tag url_options, options do %>
|
10
14
|
<%= search_field_tag :search, (search_params if search_params.is_a? String), :class => 'text-input', :id => search_input_id, :size => 50, :autocomplete => :off, :placeholder => as_(live_search ? :live_search : :search_terms) %>
|
11
|
-
<%= submit_tag as_(
|
15
|
+
<%= submit_tag as_(submit_text), :class => "submit", :style => ('display:none;' if live_search) %>
|
12
16
|
<%= link_to as_(:reset), url_for(url_options.merge(:search => '')), :class => 'as_cancel reset', :remote => true, :data => {:refresh => true} unless local_assigns[:skip_reset] %>
|
13
17
|
<%= loading_indicator_tag(:action => :search) %>
|
14
|
-
|
18
|
+
<% end %>
|
@@ -60,7 +60,7 @@ class ActiveScaffold::Bridges::RecordSelect
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def active_scaffold_record_select_autocomplete(record, column, options)
|
63
|
-
record_select_options = active_scaffold_input_text_options(options).
|
63
|
+
record_select_options = active_scaffold_input_text_options(options).reverse_merge(
|
64
64
|
:controller => active_scaffold_controller_for(record.class).controller_path
|
65
65
|
).merge(column.options)
|
66
66
|
html = record_select_autocomplete(options[:name], record, record_select_options)
|
@@ -103,7 +103,7 @@ module ActiveScaffold
|
|
103
103
|
select_options = sorted_association_options_find(column.association, false, record)
|
104
104
|
else
|
105
105
|
method = column.name
|
106
|
-
select_options = column.
|
106
|
+
select_options = active_scaffold_enum_options(column, record).collect do |text, value|
|
107
107
|
active_scaffold_translated_option(column, text, value)
|
108
108
|
end
|
109
109
|
end
|
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.4.
|
4
|
+
version: 3.4.24
|
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: 2015-07-
|
11
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: brakeman
|