give sortable tables visual affordance that they're draggable

This commit is contained in:
Felix Niklas 2016-03-14 15:57:27 +01:00
parent 5a71589655
commit 41e11d9d3f
3 changed files with 8 additions and 0 deletions

View file

@ -292,6 +292,7 @@ class App.ControllerTable extends App.Controller
class: @class
destroy: destroy
callbacks: @callbackAttributes
sortable: @dndCallback
)
# convert to jquery object

View file

@ -1,6 +1,9 @@
<table class="table table-hover<%- " #{@class}" if @class %>">
<thead>
<tr>
<% if @sortable: %>
<th style="width: 36px"></th>
<% end %>
<% if @checkbox: %>
<th style="width: 40px" class="no-padding">
<label class="checkbox-replacement">
@ -49,6 +52,9 @@
<% end %>
<% position++ %>
<tr class="item<%= ' is-inactive' if object.active is false %>" data-id="<%= object.id %>" data-position="<%= position %>" >
<% if @sortable: %>
<td><%- @Icon('draggable') %></td>
<% end %>
<% if @checkbox: %>
<td class="no-padding">
<label class="checkbox-replacement">

View file

@ -924,6 +924,7 @@ th.align-right {
}
}
.table .icon-draggable,
.table .icon-trash {
vertical-align: middle;
fill: hsl(240,1%,77%);