moveDown method

bool moveDown()

Moves this node down in parent's children.

Implementation

bool moveDown() {
  if (!hasParent) return false;
  var parentRuntime = this.parentRuntime;

  var idx = indexInParent;
  if (idx < 0) return false;
  if (idx >= parentRuntime!.nodesLength - 1) return true;

  remove();

  var idxDown = parentRuntime._contentFromIndexForwardWhere(
      idx, 1, (node) => domGenerator.isElementNode(node));
  if (idxDown < 0) {
    idxDown = parentRuntime.nodesLength;
  }

  parentRuntime.insertAt(idxDown, node);
  return true;
}