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

kommitters / editorjs-toggle-block / 10904908499

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

Pull #246

github

web-flow
Merge 21424974e into d421e3fc1
Pull Request #246: V0.3

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/nest/setEventsToNestedBlock.js
1
/**
2
   * Sets the events to be listened through the holder
3
   * in a nested block.
4
   *
5
   * @param {KeyboardEvent} e - key down event
6
   */
7
export default function setEventsToNestedBlock(e) {
NEW
8
  if (e.code === 'Enter') {
×
NEW
9
    setTimeout(() => this.createParagraphFromIt());
×
10
  } else {
NEW
11
    const indexBlock = this.getCurrentBlockIndex();
×
NEW
12
    const nestedBlock = this.getBlockByIndex(indexBlock);
×
NEW
13
    const { holder } = nestedBlock;
×
14

NEW
15
    if (e.code === 'Tab' && e.shiftKey) {
×
NEW
16
      this.extractBlock(indexBlock);
×
17
    }
NEW
18
    if (e.code === 'Backspace') {
×
NEW
19
      const cursorPosition = document.getSelection().focusOffset;
×
NEW
20
      this.removeBlock(holder, nestedBlock.id, cursorPosition);
×
21
    }
22
  }
23
}
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