Skip to content

Commit 06afc77

Browse files
committed
Supported sortable resource item on asset
1 parent e4cf794 commit 06afc77

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

app/views/asset_resource_items/index.html.erb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
<td class="name"><%= link_to i.name, edit_project_asset_resource_item_path(@project, i) %></td>
3030
<td class="date"><%= format_date(i.start_date) %></td>
3131
<td class="date"><%= format_date(i.end_date) %></td>
32-
<td><%= delete_link project_asset_resource_item_path(@project, i) %></td>
32+
<td class="buttons">
33+
<%= reorder_handle(i, url: project_asset_resource_item_path(@project, i)) %>
34+
<%= delete_link project_asset_resource_item_path(@project, i) %>
35+
</td>
3336
</tr>
3437
<% end %>
3538
</tbody>
@@ -38,3 +41,13 @@
3841
<p class="nodata"><%= l :label_no_data %></p>
3942
<% end %>
4043

44+
<%= javascript_tag do %>
45+
$(function() {
46+
$("table.resource_items tbody").positionedItems({
47+
scroll: false,
48+
sort: function (event, ui) {
49+
ui.helper.css({'top': ui.position.top + $(window).scrollTop() + 'px'});
50+
},
51+
});
52+
});
53+
<% end %>

0 commit comments

Comments
 (0)