table drag and drop: keep row width

This commit is contained in:
Felix Niklas 2016-03-14 15:35:40 +01:00
parent 7fcb2699b8
commit 0f02b440d4

View file

@ -40,6 +40,13 @@ class App.ControllerTable extends App.Controller
opacity: 0.6 opacity: 0.6
forcePlaceholderSize: true forcePlaceholderSize: true
items: 'tr' items: 'tr'
helper: (e, tr) ->
originals = tr.children()
helper = tr.clone()
helper.children().each (index) ->
# Set helper cell sizes to match the original sizes
$(this).width( originals.eq(index).outerWidth() )
return helper
update: @dndCallback update: @dndCallback
@el.find('table > tbody').sortable(dndOptions) @el.find('table > tbody').sortable(dndOptions)