diff --git a/service.js b/service.js index 62cf58b..dab0959 100644 --- a/service.js +++ b/service.js @@ -354,6 +354,13 @@ class BesService { this.findNextMistake(1) } break + case 'Enter': + if (e.ctrlKey) { + e.preventDefault() + e.stopPropagation() + // TODO: What to do when we have multiple replacements? + this.acceptReplacement() + } default: break } @@ -1023,6 +1030,11 @@ class BesService { ) } + static arrowBtnNavigation(value, service) { + const direction = value === 'forward' ? 1 : value === 'back' ? -1 : 0 + service.findNextMistake(direction) + } + /** * Creates auxiliary DOM elements for text adornments. */ @@ -1130,7 +1142,7 @@ class BesService { popup.setContent(el, match, this, this.isContentEditable()) this.highlightMistake(match) }) - popup.show(source.clientX, source.clientY) + popup.show(source.clientX, source.clientY, this) } /** @@ -1189,7 +1201,7 @@ class BesService { this.highlightMistake(match) match.highlights.forEach(el => { const clientY = `${el.y + 150}` - popup.show(el.x, clientY) + popup.show(el.x, clientY, this) }) } @@ -2863,7 +2875,7 @@ class BesPopup extends HTMLElement { padding: 3px 2px; } .bes-toolbar button { - margin-right: 2px; + margin-right: 0px; } .bes-popup-title { color: #333; @@ -2904,6 +2916,9 @@ class BesPopup extends HTMLElement { width: 100%; height: 100%; } + .bes-mistake-nav{ + margin-right: 10px; + } :host{ --bes-close-icon: #485362; --hover-bg-clr: #dee3ed; @@ -2948,12 +2963,36 @@ class BesPopup extends HTMLElement {