active_scaffold_sortable 3.3.4 → 3.3.5
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 +4 -4
- data/app/assets/javascripts/jquery/active_scaffold_sortable.js +11 -4
- data/app/assets/stylesheets/active_scaffold_sortable.css.scss +0 -1
- data/app/views/active_scaffold_overrides/_form_association.html.erb +1 -1
- data/lib/active_scaffold_sortable/version.rb +1 -1
- data/lib/active_scaffold_sortable/view_helpers.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12b3b4375b8bb35bcc851b5219b358178c9b4054
|
4
|
+
data.tar.gz: adae7a6bf7560acd094fe1338586fb7df28616ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bd583874658fea4563d85c82a5352cafa482543c081c75d8cb9448203b5bb253f5b864184279c508e952da840695f8a1793db7aaa9712718130b1cbc536aa31
|
7
|
+
data.tar.gz: df9a188389ee2ffb54fc270d750a0930eeea09eb59955147dd1c6bb5be51840222252fbd2d5e2cc93295455bf409d929bf42dc2eb43436976af1722fac830888
|
@@ -8,11 +8,18 @@ ActiveScaffold.update_positions = function(content) {
|
|
8
8
|
ActiveScaffold.sortable = function(element) {
|
9
9
|
var fixHelper = function(e, ui) {
|
10
10
|
ui.find('*').each(function() {
|
11
|
-
|
12
|
-
|
11
|
+
var $this = jQuery(this);
|
12
|
+
$this.data('sortable-prev-style', $this.attr('style'));
|
13
|
+
$this.width($this.width());
|
13
14
|
});
|
14
15
|
return ui;
|
15
16
|
};
|
17
|
+
var copyHelperToPlaceholder = function(e, ui) {
|
18
|
+
var items = ui.placeholder.find('td');
|
19
|
+
ui.helper.find('td').each(function(i) {
|
20
|
+
jQuery(items[i]).width(jQuery(this).width());
|
21
|
+
});
|
22
|
+
};
|
16
23
|
var restoreHelper = function(e, ui) {
|
17
24
|
ui.helper.find('*').each(function() {
|
18
25
|
var style = jQuery(this).data('sortable-prev-style');
|
@@ -21,7 +28,7 @@ ActiveScaffold.sortable = function(element) {
|
|
21
28
|
jQuery(this).removeData('sortable-prev-style');
|
22
29
|
});
|
23
30
|
};
|
24
|
-
var form, content, sortable_options = {containment: 'parent', tolerance: 'pointer', forcePlaceholderSize: true, placeholder: 'sortable-highlight', helper: fixHelper, beforeStop: restoreHelper};
|
31
|
+
var form, content, sortable_options = {containment: 'parent', tolerance: 'pointer', forcePlaceholderSize: true, placeholder: 'sortable-highlight', helper: fixHelper, beforeStop: restoreHelper, start: copyHelperToPlaceholder};
|
25
32
|
if (typeof(element) == 'string') {
|
26
33
|
content = jQuery('#' + element);
|
27
34
|
element = content.closest('.sortable-container');
|
@@ -50,7 +57,7 @@ ActiveScaffold.sortable = function(element) {
|
|
50
57
|
}
|
51
58
|
}
|
52
59
|
sortable_options.handle = element.data('handle');
|
53
|
-
sortable_options.items =
|
60
|
+
sortable_options.items = element.data('tag');
|
54
61
|
content.sortable(sortable_options);
|
55
62
|
};
|
56
63
|
|
@@ -1,6 +1,5 @@
|
|
1
1
|
.sortable-handle { cursor: move; }
|
2
2
|
.active-scaffold .sub-form table td.sortable-handle { display: table-cell; visibility: visible; }
|
3
|
-
.active-scaffold .sub-form tbody.sortable-highlight { display: table-row; }
|
4
3
|
td.sortable-handle, .active-scaffold .sub-form table td.sortable-handle {
|
5
4
|
background: image-url('active_scaffold/sortable.png') no-repeat center center;
|
6
5
|
width: 16px;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% config = active_scaffold_config_for(column.association.klass) %>
|
2
2
|
<% if config.actions.include? :sortable %>
|
3
|
-
<%= content_tag :div, render(:super), :class => 'sortable-container', :data => sort_params(config).merge(:tag =>
|
3
|
+
<%= content_tag :div, render(:super), :class => 'sortable-container', :data => sort_params(config).merge(:tag => "##{sub_form_list_id(:association => column.name, :id => parent_record.try(:id) || generated_id(parent_record) || 99999999999)} > .sub-form-record") %>
|
4
4
|
<% else %>
|
5
5
|
<%= render :super %>
|
6
6
|
<% 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.
|
4
|
+
version: 3.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Cambra
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-11-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: active_scaffold
|