js: Correctly identify a node's parent in case of first level sub-trees

This commit is contained in:
Johannes Meyer 2019-02-22 09:14:04 +01:00
parent 673135c0f3
commit c73cd65f6f
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ class TreeRenderer extends Renderer
'ul',
[
'id' => $htmlId,
'class' => ['bp', 'sortable'],
'class' => ['bp', 'sortable', $this->wantsRootNodes() ? '' : 'process'],
'data-sortable-disabled' => $this->isLocked() ? 'true' : 'false',
'data-sortable-data-id-attr' => 'id',
'data-sortable-direction' => 'vertical',

View file

@ -136,7 +136,7 @@
var data = {
csrfToken: $target.data('csrfToken'),
movenode: 'movenode', // That's the submit button..
parent: $target.parent('.process').data('nodeName') || '',
parent: $target.closest('.process').data('nodeName') || '',
from: evt.oldIndex,
to: evt.newIndex
};