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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71221bcdb5596ef2f904f7f596e893535fd524b3
|
4
|
+
data.tar.gz: a0b611c659f5ac4d9368b34cfdfa72eb5c678710
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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;
|