fix(drag): while dragging copy marginLeft to show item with right indent
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
8167f6d85d
commit
c1fe438925
|
@ -396,15 +396,19 @@ function editor(root, inputData, options) {
|
|||
}
|
||||
|
||||
function enableDragging(rootElement) {
|
||||
let start = -1;
|
||||
let startID = null;
|
||||
|
||||
let drake = dragula([rootElement], {
|
||||
moves: function (el, container, handle, sibling) {
|
||||
return handle.classList.contains('marker')
|
||||
},
|
||||
accepts: function (el, target, source, sibling) {
|
||||
el.style.marginLeft = sibling === null ? 0 : sibling.style.marginLeft
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
let start = -1;
|
||||
let startID = null;
|
||||
|
||||
drake.on('drag', function (el, source) {
|
||||
startID = $(el).attr('data-id')
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user