active_scaffold 3.4.24 → 3.4.25

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: dc9178690751a9ba0c8d602ed0d2e133dcb42d67
4
- data.tar.gz: 9a27c060e1b4953701409cc4c550b15cfe48f428
3
+ metadata.gz: 7ee6cc12616f927c3500f0da84efc6ccbf7f60bf
4
+ data.tar.gz: c4f7d12b9993f732eab7632b61b37fa36b1ac5c0
5
5
  SHA512:
6
- metadata.gz: 483dd99adb6c1f300474b5eecb0ae5377428d901896d79889b205525ba37691afe7781e6854300d6acfdd635d4cf3220afdf008a19e120ea7df89bc4d9426760
7
- data.tar.gz: b32f74e9882bc164bf6b42f613e0106dd21dc1df54eada67234198834fbc881b0f357c3af50ca1993a5462cfd3bad7fca31c897cb78a3d8bdc490044e22547ef
6
+ metadata.gz: 6b1177b6f0c4875ef0353058e0187313f390420f940a2471b8139ad46e244f0f0daeae6fce320dc5e1e9b82abd9056fc7c7b6088606836a28603db76b98fcf34
7
+ data.tar.gz: ef249a6e53a32b40d7dbaa807d5611bf576e3950c76f0ee50d3465fd30e78d1c19f23c7fbd97f179a64ccfa4074d4c04a070efe9f2f932193d1c0da3d0098c53
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ - call focus_first_element after highlight and trigger element_created
2
+ - fix restoring focus to element which triggers update column
3
+
1
4
  = 3.4.24
2
5
  - allow to set :controller in active_scaffold_record_select_autocomplete parameter or active_scaffold_input_text_options
3
6
  - fix keeping focus after update_columns when focus was changed to a field which is going to be updated
@@ -791,8 +791,8 @@ var ActiveScaffold = {
791
791
  element.prepend(content);
792
792
  }
793
793
  }
794
- ActiveScaffold.focus_first_element_of_form(content, '');
795
794
  content.trigger('as:element_created');
795
+ ActiveScaffold.focus_first_element_of_form(content, '');
796
796
  },
797
797
 
798
798
  render_form_field: function(source, content, options) {
@@ -960,10 +960,20 @@ var ActiveScaffold = {
960
960
  type: 'post',
961
961
  beforeSend: function(xhr, settings) {
962
962
  element.nextAll('img.loading-indicator').css('visibility','visible');
963
- ActiveScaffold.disable_form(as_form);
963
+ /* force to blur and save previous last_focus, because disable_form will trigger
964
+ * blur on focused element and we will not be able to restore focus later
965
+ */
966
+ var last_focus = ActiveScaffold.last_focus;
967
+ if (last_focus) {
968
+ $(last_focus).blur();
969
+ ActiveScaffold.last_focus = last_focus;
970
+ }
971
+ //ActiveScaffold.disable_form(as_form); // not needed: called from on('ajax:beforeSend', 'form.as_form')
972
+
964
973
  if ($.rails.fire(element, 'ajax:beforeSend', [xhr, settings])) {
965
974
  element.trigger('ajax:send', xhr);
966
975
  } else {
976
+ $(ActiveScaffold.last_focus).focus();
967
977
  return false;
968
978
  }
969
979
  },
@@ -1232,8 +1242,8 @@ ActiveScaffold.ActionLink.Record = ActiveScaffold.ActionLink.Abstract.extend({
1232
1242
  else {
1233
1243
  return false;
1234
1244
  }
1235
- ActiveScaffold.focus_first_element_of_form(this.adapter);
1236
1245
  ActiveScaffold.highlight(this.adapter.find('td'));
1246
+ ActiveScaffold.focus_first_element_of_form(this.adapter);
1237
1247
  },
1238
1248
 
1239
1249
  close: function(refreshed_content_or_reload) {
@@ -1300,7 +1310,7 @@ ActiveScaffold.ActionLink.Table = ActiveScaffold.ActionLink.Abstract.extend({
1300
1310
  else {
1301
1311
  throw 'Unknown position "' + this.position + '"'
1302
1312
  }
1303
- ActiveScaffold.focus_first_element_of_form(this.adapter);
1304
1313
  ActiveScaffold.highlight(this.adapter.find('td').first().children());
1314
+ ActiveScaffold.focus_first_element_of_form(this.adapter);
1305
1315
  }
1306
1316
  });
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 4
5
- PATCH = 24
5
+ PATCH = 25
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.24
4
+ version: 3.4.25
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-31 00:00:00.000000000 Z
11
+ date: 2015-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brakeman