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

Method remove

src/components/blocks.ts:285–295  ·  view source on GitHub ↗

* Remove block * * @param {number} index - index of Block to remove

(index: number)

Source from the content-addressed store, hash-verified

283 * @param {number} index - index of Block to remove
284 */
285 public remove(index: number): void {
286 if (isNaN(index)) {
287 index = this.length - 1;
288 }
289
290 this.blocks[index].holder.remove();
291
292 this.blocks[index].call(BlockToolAPI.REMOVED);
293
294 this.blocks.splice(index, 1);
295 }
296
297 /**
298 * Remove all blocks

Callers 5

removeAllNodesMethod · 0.45
dropCursorMethod · 0.45
insertMethod · 0.45
removeFakeCursorMethod · 0.45

Calls 1

callMethod · 0.65

Tested by

no test coverage detected