app/assets/javascripts/utils/content/editor/item.js in katalyst-content-0.2.0 vs app/assets/javascripts/utils/content/editor/item.js in katalyst-content-0.2.1

- old
+ new

@@ -129,11 +129,11 @@ // specifically, setting depth affects calculation const expanded = this.#expandedDescendants; callback(this); this.#traverseCollapsed(callback); - expanded.forEach((item) => this.#traverseCollapsed(item)); + expanded.forEach((item) => item.#traverseCollapsed(callback)); } /** * Recursively traverse the node's collapsed descendants, if any. * @@ -147,35 +147,16 @@ item.#traverseCollapsed(callback); }); } /** - * Increase the depth of this item and its descendants. - * If this causes it to become a child of a collapsed item, then collapse this item. - */ - nest() { - this.traverse((child) => { - child.depth += 1; - }); - } - - /** * Move the given item into this element's hidden children list. * Assumes the list already exists. * * @param item {Item} */ collapseChild(item) { this.#childrenListElement.appendChild(item.node); - } - - /** - * Decrease the depth of this item (and its descendants). - */ - deNest() { - this.traverse((child) => { - child.depth -= 1; - }); } /** * Collapses visible (logical) children into this element's hidden children * list, creating it if it doesn't already exist.