* Adds fake cursor to the current range
()
| 370 | * Adds fake cursor to the current range |
| 371 | */ |
| 372 | public static addFakeCursor(): void { |
| 373 | const range = SelectionUtils.range; |
| 374 | |
| 375 | if (range === null) { |
| 376 | return; |
| 377 | } |
| 378 | |
| 379 | const fakeCursor = $.make('span', 'codex-editor__fake-cursor'); |
| 380 | |
| 381 | fakeCursor.dataset.mutationFree = 'true'; |
| 382 | |
| 383 | range.collapse(); |
| 384 | range.insertNode(fakeCursor); |
| 385 | } |
| 386 | |
| 387 | /** |
| 388 | * Check if passed element contains a fake cursor |