Add supporting themes required for Lotusdocs
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// @flow
|
||||
import { isElement } from './instanceOf';
|
||||
import type { Window } from '../types';
|
||||
|
||||
export default function getDocumentElement(
|
||||
element: Element | Window
|
||||
): HTMLElement {
|
||||
// $FlowFixMe[incompatible-return]: assume body is always available
|
||||
return (
|
||||
(isElement(element)
|
||||
? element.ownerDocument
|
||||
: // $FlowFixMe[prop-missing]
|
||||
element.document) || window.document
|
||||
).documentElement;
|
||||
}
|
||||
Reference in New Issue
Block a user