active_scaffold_sortable 3.3.1 → 3.3.2

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: 1492534bbf5bf0ae3b14f8083cb416449e963d56
4
- data.tar.gz: 240734c1c652fe8410ed54a51cdfb8087eb8dbb3
3
+ metadata.gz: 71221bcdb5596ef2f904f7f596e893535fd524b3
4
+ data.tar.gz: a0b611c659f5ac4d9368b34cfdfa72eb5c678710
5
5
  SHA512:
6
- metadata.gz: 7009981cb6e297c4794fc29c9e32399f132f2d560eb092f01d9ab177fee1ef9202892ddf224d8de04b4618d55d36f62a8f73b6ef9e01f941b31e6d7bae6008cd
7
- data.tar.gz: a806fccf5949785ccef9cd6878316f68b777bef939cda32a3923668a4af7393e19d1c8e5c19dbc8c1e0cd963b4a460f00cb34da563008ebcadd7e80f76b03c78
6
+ metadata.gz: af81bd998a18795ad13c48173598aa09a1d228d935cbf13c7aa46a3f042255090867f5dbaabb8b3d8d498e37d6190df7a5a4b2be83e47265403bd614c4f9253a
7
+ data.tar.gz: a6c2a3b4c8bf67c1eb31afe18cd490b71b2c7312138d5025b5e86728e6d556a7df8818cde460a458eac5199db7498a9687d26946b169054911c84adcb6346a76
@@ -13,15 +13,15 @@ ActiveScaffold.sortable = function(element) {
13
13
  });
14
14
  return ui;
15
15
  };
16
- var restoreHelper = function(ui) {
17
- ui.find('*').each(function() {
16
+ var restoreHelper = function(e, ui) {
17
+ ui.helper.find('*').each(function() {
18
18
  var style = $(this).data('sortable-prev-style');
19
19
  if (style) $(this).attr('style', style);
20
20
  else $(this).removeAttr('style');
21
21
  $(this).removeData('sortable-prev-style');
22
22
  });
23
23
  };
24
- var form, content, sortable_options = {containment: 'parent', tolerance: 'pointer', forcePlaceholderSize: true, placeholder: 'sortable-highlight', helper: fixHelper};
24
+ var form, content, sortable_options = {containment: 'parent', tolerance: 'pointer', forcePlaceholderSize: true, placeholder: 'sortable-highlight', helper: fixHelper, beforeStop: restoreHelper};
25
25
  if (typeof(element) == 'string') {
26
26
  content = jQuery('#' + element);
27
27
  element = content.closest('.sortable-container');
@@ -35,7 +35,6 @@ ActiveScaffold.sortable = function(element) {
35
35
 
36
36
  if (form) {
37
37
  sortable_options.update = function(event, ui) {
38
- restoreHelper(content);
39
38
  ActiveScaffold.update_positions(content);
40
39
  };
41
40
  } else {
@@ -43,7 +42,6 @@ ActiveScaffold.sortable = function(element) {
43
42
  if (url) {
44
43
  var csrf = jQuery('meta[name=csrf-param]').attr('content') + '=' + jQuery('meta[name=csrf-token]').attr('content');
45
44
  sortable_options.update = function(event, ui) {
46
- restoreHelper(content);
47
45
  var body = jQuery(this).sortable('serialize',{key: encodeURIComponent(jQuery(this).attr('id') + '[]'), expression: new RegExp(element.data('format'))});
48
46
  var params = element.data('with');
49
47
  if (params) body += '&' + params;
@@ -2,7 +2,7 @@ module ActiveScaffoldSortable
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 3
5
- PATCH = 1
5
+ PATCH = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold_sortable
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra