add dragula in project values

stable
Juanfran 2016-04-26 13:09:16 +02:00
parent 49b4eb41d8
commit 2a3dea54b0
1 changed files with 8 additions and 8 deletions

View File

@ -492,16 +492,16 @@ ProjectCustomAttributesDirective = ($log, $confirm, animationFrame, $translate)
# Drag & Drop # Drag & Drop
################################## ##################################
sortableEl = $el.find(".js-sortable") sortableEl = $el.find(".js-sortable")
drake = dragula([sortableEl[0]], {
sortableEl.sortable({ direction: 'vertical',
handle: ".js-view-custom-field", copySortSource: false,
dropOnEmpty: true copy: false,
revert: 400 mirrorContainer: sortableEl[0],
axis: "y" moves: (item) -> return $(item).is('div[tg-bind-scope]')
}) })
sortableEl.on "sortstop", (event, ui) -> drake.on 'dragend', (item) ->
itemEl = ui.item itemEl = $(item)
itemAttr = itemEl.scope().attr itemAttr = itemEl.scope().attr
itemIndex = itemEl.index() itemIndex = itemEl.index()
$ctrl.moveCustomAttributes(itemAttr, itemIndex) $ctrl.moveCustomAttributes(itemAttr, itemIndex)