From f25e93ad4bfb825185d96909e6e724a4d1f9c626 Mon Sep 17 00:00:00 2001 From: void Date: Sat, 27 Mar 2021 18:45:46 +0000 Subject: [PATCH] editor: chore: estilo --- app/javascript/editor/editor.ts | 5 ++++- app/javascript/editor/types.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/javascript/editor/editor.ts b/app/javascript/editor/editor.ts index 6bc18df6..167d40db 100644 --- a/app/javascript/editor/editor.ts +++ b/app/javascript/editor/editor.ts @@ -1,5 +1,8 @@ import { storeContent, restoreContent, forgetContent } from 'editor/storage' -import { isDirectChild, moveChildren, safeGetSelection, safeGetRangeAt, setAuxiliaryToolbar, parentBlockNames, clearSelected } from 'editor/utils' +import { + isDirectChild, moveChildren, safeGetSelection, safeGetRangeAt, + setAuxiliaryToolbar, parentBlockNames, clearSelected, +} from 'editor/utils' import { types, getValidChildren, getType } from 'editor/types' import { setupButtons as setupMarksButtons } from 'editor/types/marks' import { setupButtons as setupBlocksButtons } from 'editor/types/blocks' diff --git a/app/javascript/editor/types.ts b/app/javascript/editor/types.ts index 9bce8097..8034e3e4 100644 --- a/app/javascript/editor/types.ts +++ b/app/javascript/editor/types.ts @@ -51,8 +51,11 @@ export const types: { [propName: string]: EditorNode } = { export function getType (node: Element): { typeName: string, type: EditorNode } | null { for (let [typeName, type] of Object.entries(types)) { - if (node.matches(type.selector)) return { typeName, type } + if (node.matches(type.selector)) { + return { typeName, type } + } } + return null }