give sortable tables visual affordance that they're draggable
This commit is contained in:
parent
5a71589655
commit
41e11d9d3f
3 changed files with 8 additions and 0 deletions
|
@ -292,6 +292,7 @@ class App.ControllerTable extends App.Controller
|
||||||
class: @class
|
class: @class
|
||||||
destroy: destroy
|
destroy: destroy
|
||||||
callbacks: @callbackAttributes
|
callbacks: @callbackAttributes
|
||||||
|
sortable: @dndCallback
|
||||||
)
|
)
|
||||||
|
|
||||||
# convert to jquery object
|
# convert to jquery object
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
<table class="table table-hover<%- " #{@class}" if @class %>">
|
<table class="table table-hover<%- " #{@class}" if @class %>">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<% if @sortable: %>
|
||||||
|
<th style="width: 36px"></th>
|
||||||
|
<% end %>
|
||||||
<% if @checkbox: %>
|
<% if @checkbox: %>
|
||||||
<th style="width: 40px" class="no-padding">
|
<th style="width: 40px" class="no-padding">
|
||||||
<label class="checkbox-replacement">
|
<label class="checkbox-replacement">
|
||||||
|
@ -49,6 +52,9 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% position++ %>
|
<% position++ %>
|
||||||
<tr class="item<%= ' is-inactive' if object.active is false %>" data-id="<%= object.id %>" data-position="<%= 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: %>
|
<% if @checkbox: %>
|
||||||
<td class="no-padding">
|
<td class="no-padding">
|
||||||
<label class="checkbox-replacement">
|
<label class="checkbox-replacement">
|
||||||
|
|
|
@ -924,6 +924,7 @@ th.align-right {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.table .icon-draggable,
|
||||||
.table .icon-trash {
|
.table .icon-trash {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
fill: hsl(240,1%,77%);
|
fill: hsl(240,1%,77%);
|
||||||
|
|
Loading…
Reference in a new issue