MCPcopy
hub / github.com/codex-team/editor.js / insertAfter

Method insertAfter

src/components/blocks.ts:315–319  ·  view source on GitHub ↗

* Insert Block after passed target * * @todo decide if this method is necessary * @param {Block} targetBlock — target after which Block should be inserted * @param {Block} newBlock — Block to insert

(targetBlock: Block, newBlock: Block)

Source from the content-addressed store, hash-verified

313 * @param {Block} newBlock — Block to insert
314 */
315 public insertAfter(targetBlock: Block, newBlock: Block): void {
316 const index = this.blocks.indexOf(targetBlock);
317
318 this.insert(index + 1, newBlock);
319 }
320
321 /**
322 * Get Block by index

Callers

nothing calls this directly

Calls 2

insertMethod · 0.95
indexOfMethod · 0.80

Tested by

no test coverage detected