moveUp method

bool moveUp()

Moves this node up in parent's children.

Implementation

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

  var idx = indexInParent;
  if (idx < 0) return false;
  if (idx == 0) return true;

  remove();

  var idxUp = parentRuntime!._contentFromIndexBackwardWhere(
      idx - 1, 0, (node) => domGenerator.isElementNode(node));
  if (idxUp < 0) {
    idxUp = 0;
  }

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