mirror of
https://github.com/codex-team/editor.js
synced 2026-03-14 22:55:47 +01:00
Apply suggestions from code review
Co-authored-by: Peter <specc.dev@gmail.com> Co-authored-by: KoshaevEugeny <103786108+akulistus@users.noreply.github.com>
This commit is contained in:
parent
5cfd9881c5
commit
714ee3e6ef
2 changed files with 2 additions and 2 deletions
|
|
@ -572,7 +572,7 @@ export default class Dom {
|
|||
* @param element - element to check
|
||||
* @returns {HTMLAnchorElement | null}
|
||||
*/
|
||||
public static getAnchor(element: Element): HTMLAnchorElement | null {
|
||||
public static getClosestAnchor(element: Element): HTMLAnchorElement | null {
|
||||
return element.closest("a");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -773,7 +773,7 @@ export default class UI extends Module<UINodes> {
|
|||
*/
|
||||
const element = event.target as Element;
|
||||
const ctrlKey = event.metaKey || event.ctrlKey;
|
||||
const anchor = $.getAnchor(element);
|
||||
const anchor = $.getClosestAnchor(element);
|
||||
|
||||
if (anchor && ctrlKey) {
|
||||
event.stopImmediatePropagation();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue