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

Method selectBlock

src/components/modules/blockSelection.ts:345–357  ·  view source on GitHub ↗

* Select passed Block * * @param {Block} block - Block to select

(block: Block)

Source from the content-addressed store, hash-verified

343 * @param {Block} block - Block to select
344 */
345 public selectBlock(block: Block): void {
346 /** Save selection */
347 this.selection.save();
348 SelectionUtils.get()
349 .removeAllRanges();
350
351 block.selected = true;
352
353 this.clearCache();
354
355 /** close InlineToolbar when we selected any Block */
356 this.Editor.InlineToolbar.close();
357 }
358
359 /**
360 * Remove selection from passed Block

Callers 4

selectBlockByIndexMethod · 0.95
handleCommandAMethod · 0.95
setToBlockMethod · 0.80
openMethod · 0.80

Calls 4

clearCacheMethod · 0.95
saveMethod · 0.65
getMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected