GeneralStepUi#_sortGroups: correct group sorting
The modified parent was not the parent of groups, so the group DOM operations failed.master
parent
d9e13f6326
commit
c56d6ac7b2
|
@ -1069,9 +1069,10 @@ module.exports = Class( 'StepUi' )
|
||||||
// TODO: this makes the assumption that there is a parent node; we
|
// TODO: this makes the assumption that there is a parent node; we
|
||||||
// should not be concerned with that, and should find some other way
|
// should not be concerned with that, and should find some other way
|
||||||
// of hiding the entire step while sorting (which the Ui handles)
|
// of hiding the entire step while sorting (which the Ui handles)
|
||||||
var parent = this.$content[ 0 ].parentNode,
|
var step_node = this.$content[ 0 ].parentNode,
|
||||||
container = parent.parentNode,
|
container = step_node.parentNode,
|
||||||
sibling = parent.nextSibling,
|
sibling = step_node.nextSibling,
|
||||||
|
parent = prev.parentNode,
|
||||||
i = len - 1;
|
i = len - 1;
|
||||||
|
|
||||||
if ( !container )
|
if ( !container )
|
||||||
|
@ -1082,7 +1083,7 @@ module.exports = Class( 'StepUi' )
|
||||||
// to prevent DOM updates for each and every group move, detach the node
|
// to prevent DOM updates for each and every group move, detach the node
|
||||||
// that contains all the groups from the DOM; we'll re-add it after
|
// that contains all the groups from the DOM; we'll re-add it after
|
||||||
// we're done
|
// we're done
|
||||||
container.removeChild( parent );
|
container.removeChild( step_node );
|
||||||
|
|
||||||
// we can sort the groups in place without screwing up the DOM by simply
|
// we can sort the groups in place without screwing up the DOM by simply
|
||||||
// starting with the last node and progressively inserting nodes
|
// starting with the last node and progressively inserting nodes
|
||||||
|
@ -1124,11 +1125,11 @@ module.exports = Class( 'StepUi' )
|
||||||
// update, maintaining element order
|
// update, maintaining element order
|
||||||
if ( sibling )
|
if ( sibling )
|
||||||
{
|
{
|
||||||
container.insertBefore( parent, sibling );
|
container.insertBefore( step_node, sibling );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
container.appendChild( parent );
|
container.appendChild( step_node );
|
||||||
}
|
}
|
||||||
|
|
||||||
callback();
|
callback();
|
||||||
|
|
Loading…
Reference in New Issue