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

kommitters / editorjs-toggle-block / 10856842690

13 Sep 2024 10:17PM UTC coverage: 31.442% (-0.7%) from 32.139%
10856842690

Pull #242

github

web-flow
Merge c2da1ab21 into 152a5cd00
Pull Request #242: General decoupling in functions

77 of 370 branches covered (20.81%)

Branch coverage included in aggregate %.

95 of 477 new or added lines in 22 files covered. (19.92%)

3 existing lines in 1 file now uncovered.

250 of 670 relevant lines covered (37.31%)

29.51 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
  /**
15
   * Removes all properties of a nested block.
16
   *
17
   * @param {number} destiny - block position
18
   */
19
export function removeAttributesFromNewBlock(destiny) {
NEW
20
    const newBlock = this.api.blocks.getBlockByIndex(destiny);
×
NEW
21
    const { holder } = newBlock;
×
22

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

NEW
28
    holder.removeAttribute("foreignKey");
×
NEW
29
    holder.removeAttribute("id");
×
NEW
30
    holder.onkeydown = {};
×
NEW
31
    holder.onkeyup = {};
×
NEW
32
    holder.classList.remove("toggle-block__item");
×
33
  }
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