Sha256: 6faf22020030a20a0a2f17e337830c85b1a70b82d81bfd34921b355ce3b3a7b5
Contents?: true
Size: 1.34 KB
Versions: 182
Compression:
Stored size: 1.34 KB
Contents
<h1>Edit Sort Order</h1> <a href="/admin/agents" class="caboose-btn">Back to Agents</a> <ul class="sortable" id="sortable_agents"> <% @agents.each do |agent| %> <li id="agent_<%= agent.id %>" class="clearfix ui-state-default" data-paid="<%= agent.id %>"> <span class="ui-icon ui-icon-arrowthick-2-n-s"></span> <span class="resource-title"><%= agent.full_name %></span> </li> <% end %> </ul> <% content_for :caboose_css do %> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <style> .sortable { list-style-type: none; padding-left: 0; } .sortable li { cursor: ns-resize; width: 800px; padding: 3px 6px; } .sortable li a { color: #0357FF; font-size: 14px; } .sortable li a:hover { text-decoration: underline; } .ui-state-default .ui-icon { display: inline-block; } </style> <% end %> <% content_for :caboose_js do %> <script> function change_sort_order(data) { $.ajax({ url: '/admin/agents/update-sort', type: 'put', data: data, success: function(resp) { } }); } $(document).ready(function() { var sort = $(".sortable"); sort.sortable({ update: function(event, ui) { change_sort_order( sort.sortable('serialize') ); } }); }); </script> <% end %>
Version data entries
182 entries across 182 versions & 1 rubygems