perf: review tinymce code

This commit is contained in:
vben
2020-10-22 23:56:33 +08:00
parent 9c02d8ec08
commit f75425d13b
26 changed files with 350 additions and 535 deletions

View File

@@ -67,3 +67,7 @@ export const isServer = typeof window === 'undefined';
export function isImageDom(o: Element) {
return o && ['IMAGE', 'IMG'].includes(o.tagName);
}
export const isTextarea = (element: Element | null): element is HTMLTextAreaElement => {
return element !== null && element.tagName.toLowerCase() === 'textarea';
};