active_scaffold_sortable 3.3.10 → 3.4.0

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
  SHA256:
3
- metadata.gz: d70b6e4f025e689fb53925722bb1deda409627cbdcede20161190c3ca10b76b9
4
- data.tar.gz: 81885ddbf593c12ad5961b22a7a0058a6afdc4c02486fc5125ca582f3181fe51
3
+ metadata.gz: 32d846a77db73022d77fae9f89593c42fc18f4146a1c694ad3deb66b02e2b1cd
4
+ data.tar.gz: 8d82537f1748352064e4100c03feaa663369c45cde7c35ce743f52e34f7c4204
5
5
  SHA512:
6
- metadata.gz: 6e6230b9887d5541c296736408abad598dedf220ab60364a59e2d0ca40e7faee04bb159758f32939adcfaea03d7f710917e94774baface663f453833a3115fa5
7
- data.tar.gz: 425dc8d853fcd44e17a3d4fce9a4b4e0a83f5da637d7013e23eb9b386133175b3b1d41efa2a16319c2ae6df938015c67e690317ccad2bb4e28556bf1854c06b4
6
+ metadata.gz: e31694f1969a08cb691c27efae01488e6b255913b13dddb82abdb1c1a925f763b6cdc754c8e9cba002f50181baed071e370e788ad5b2fbc2896ddc7fb5d66456
7
+ data.tar.gz: 233c34441179b5478ab70f7afeda6d5c4c7b731f2db9611c0d110c7821496bae33ff83644678520b4cd3c363740157673d06517608ae187656b6628a89c66695
@@ -37,7 +37,7 @@ ActiveScaffold.sortable = function(element) {
37
37
  element = jQuery(element);
38
38
  form = element.closest('form.as_form').length > 0;
39
39
  if (form) content = element;
40
- else content = element.find('.records:first');
40
+ else content = element.find(element.data('contentSelector') || '.records:first');
41
41
  }
42
42
 
43
43
  if (form) {
@@ -49,7 +49,8 @@ ActiveScaffold.sortable = function(element) {
49
49
  if (url) {
50
50
  var csrf = jQuery('meta[name=csrf-param]').attr('content') + '=' + jQuery('meta[name=csrf-token]').attr('content');
51
51
  sortable_options.update = function(event, ui) {
52
- var body = jQuery(this).sortable('serialize',{key: encodeURIComponent(jQuery(this).attr('id') + '[]'), expression: new RegExp(element.data('format'))});
52
+ var $this = jQuery(this),
53
+ body = $this.sortable('serialize',{key: encodeURIComponent(($this.data('key') || $this.attr('id')) + '[]'), expression: new RegExp(element.data('format'))});
53
54
  var params = element.data('with');
54
55
  if (params) body += '&' + params;
55
56
  jQuery.post(url, body + '&' + csrf);
@@ -1,8 +1,8 @@
1
1
  module ActiveScaffoldSortable
2
2
  module Version
3
3
  MAJOR = 3
4
- MINOR = 3
5
- PATCH = 10
4
+ MINOR = 4
5
+ PATCH = 0
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.10
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra