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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7165870ea614c4b6716d2e3471179817ddff211
4
- data.tar.gz: d8cf35a1036360fc2f78e061b1f1e34d54b4449f
3
+ metadata.gz: dc9178690751a9ba0c8d602ed0d2e133dcb42d67
4
+ data.tar.gz: 9a27c060e1b4953701409cc4c550b15cfe48f428
5
5
  SHA512:
6
- metadata.gz: 85707d87e834e46b05a286db1dd795980c9329c53563d28238a69e459a72a7825d2faf78ff55898d0cf58b4180932d5cd4eafba81c9ca62a743e5ea23d0a3884
7
- data.tar.gz: 262c83c84c084418072a6706d9db22b0f9d04d93b5fa6fa4be552b386663ffd18f2c3b2ca252cf039f2e302ea7fc4c5c0d44ba954d9d63bab349d6a2deebb70b
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)).focus();
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) jQuery(ActiveScaffold.last_focus).focus().select();
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
- <% url_options ||= params_for(:action => :index, :search => nil) -%>
2
- <%=
3
- options = {:id => element_form_id(:action => 'search'),
4
- :class => "as_form search",
5
- :remote => xhr ||= request.xhr?,
6
- :method => :get,
7
- 'data-loading' => true}
8
- form_tag url_options, options %>
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_(:search), :class => "submit" %>
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
- <% live_search = active_scaffold_config.search.live? -%>
2
- <% url_options = params_for(:action => :index).delete_if{|k,v| k == 'search'} -%>
3
- <%=
4
- options = {:id => element_form_id(:action => 'search'),
5
- :class => "as_form search#{' live' if live_search}",
6
- :remote => xhr ||= request.xhr?,
7
- :'data-loading' => true,
8
- :method => :get}
9
- form_tag url_options, options %>
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_(:search), :class => "submit", :style => ('display:none;' if live_search) %>
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
- </form>
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).merge(
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.options[:options].collect do |text, value|
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
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 4
5
- PATCH = 23
5
+ PATCH = 24
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  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.23
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-22 00:00:00.000000000 Z
11
+ date: 2015-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brakeman