• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kommitters / editorjs-toggle-block / 10905088009

17 Sep 2024 02:24PM UTC coverage: 30.939% (-1.2%) from 32.139%
10905088009

push

github

web-flow
Merge pull request #246 from kommitters/v0.3

Release v0.3.17

73 of 367 branches covered (19.89%)

Branch coverage included in aggregate %.

77 of 456 new or added lines in 24 files covered. (16.89%)

4 existing lines in 1 file now uncovered.

250 of 677 relevant lines covered (36.93%)

29.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/blocks/removeBlockAndAttributes.js
1
/**
2
   * When a nested block is removed, the 'items' attribute
3
   * is updated, subtracting from it an unit.
4
   * @param {string} id - block identifier
5
   */
6
export function removeBlock(holder, id, cursorPosition) {
NEW
7
  if (cursorPosition === 0) {
×
NEW
8
    const position = this.itemsId.indexOf(id);
×
NEW
9
    this.itemsId.splice(position, 1);
×
10
  }
11
}
12

13
/**
14
   * Removes all properties of a nested block.
15
   *
16
   * @param {number} destiny - block position
17
   */
18
export function removeAttributesFromNewBlock(destiny) {
NEW
19
  const newBlock = this.api.blocks.getBlockByIndex(destiny);
×
NEW
20
  const { holder } = newBlock;
×
21

NEW
22
  if (!this.itemsId.includes(newBlock.id)) {
×
NEW
23
    const i = this.itemsId.indexOf(newBlock.id);
×
NEW
24
    this.itemsId.splice(i, 1);
×
25
  }
26

NEW
27
  holder.removeAttribute('foreignKey');
×
NEW
28
  holder.removeAttribute('id');
×
NEW
29
  holder.onkeydown = {};
×
NEW
30
  holder.onkeyup = {};
×
NEW
31
  holder.classList.remove('toggle-block__item');
×
32
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc