Skip to content

Commit

Permalink
Update docs for getNextNode and related methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mbraak committed Feb 24, 2024
1 parent cf3e229 commit 15e8d05
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
7 changes: 3 additions & 4 deletions docs/_entries/node/getnextnode.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ title: getNextNode
name: node-functions-getnextnode
---

Get the next node in the tree.
Get the next node in the tree. This is the next sibling, if there is one. Or, if there is no next sibling, a node further down in the tree.

- If the node has children, return the first child.
- If the node is the last child, return the next sibling of the parent.
This is the next sibling, if there is one. Or, if there is no next sibling, a node further up in the tree.

Returns a node or null.
- Returns a node or null.

{% highlight js %}
var node = node.getNextNode();
Expand Down
5 changes: 4 additions & 1 deletion docs/_entries/node/getnextvisiblenode.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ name: node-functions-getnextvisivlenode

Get the next visible node in the tree. Does the same as using the _down_ key.

Returns a node or null.
This is the previous sibling, if there is one. Or, if there is no previous sibling, a node further up in the tree that is visible.

- Returns a node or null.
- A node is visible if all its parents are open.

{% highlight js %}
var node = node.getNextVisibleNode();
Expand Down
4 changes: 1 addition & 3 deletions docs/_entries/node/getpreviousnode.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ title: getPreviousNode
name: node-functions-getpreviousnode
---

Return the previous node in the tree.

Returns a node or null.
Return the previous node in the tree. This is the previous sibling, if there is one. Or, if there is no previous sibling, a node further up in the tree.

{% highlight js %}
var node = node.getPreviousNode();
Expand Down
9 changes: 5 additions & 4 deletions docs/_entries/node/getpreviousvisiblenode.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ title: getPreviousVisibleNode
name: node-functions-getpreviousvisiblenode
---

- Get the previous visible node in the tree. Does the same as using the _up_ key.
- If the previous node is an open parent: return the last child of the node.
- If the previous node is a closed parent: skip the child nodes of the previous parent, return the previous parent node.
Get the previous visible node in the tree. Does the same as using the _up_ key.

Returns a node or null.
This is the previous sibling, if there is one. Or, if there is no previous sibling, a node further up in the tree that is visible.

- Returns a node or null.
- A node is visible if all its parents are open.

{% highlight js %}
var node = node.getPreviousVisibleNode();
Expand Down

0 comments on commit 15e8d05

Please sign in to comment.