(
newNode: Parent,
refNode: Nullable<Parent> = null,
source = 'user',
)
| 185 | } |
| 186 | |
| 187 | insertBefore( |
| 188 | newNode: Parent, |
| 189 | refNode: Nullable<Parent> = null, |
| 190 | source = 'user', |
| 191 | ) { |
| 192 | newNode.parent = this; |
| 193 | this.children.insertBefore(newNode, refNode); |
| 194 | this.domNode!.insertBefore( |
| 195 | newNode.domNode!, |
| 196 | refNode ? refNode.domNode! : null, |
| 197 | ); |
| 198 | |
| 199 | if (source === 'user') { |
| 200 | // dispatch json1 operation |
| 201 | const path = newNode.getJsonPath(); |
| 202 | const state = newNode.getState(); |
| 203 | this.jsonState.insertOperation(path, state); |
| 204 | } |
| 205 | |
| 206 | return newNode; |
| 207 | } |
| 208 | |
| 209 | insertAfter(newNode: Parent, refNode: Nullable<Parent> = null, source = 'user') { |
| 210 | this.insertBefore(newNode, refNode ? refNode.next : null, source); |
no test coverage detected