add dragula in project values
parent
49b4eb41d8
commit
2a3dea54b0
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue