Skip to content

Commit

Permalink
Remove caching for body element (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshalaby authored Mar 26, 2020
1 parent 91b9ee7 commit 70adc2e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/sugar/src/main/ts/ephox/sugar/api/node/Body.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Thunk } from '@ephox/katamari';
import Element from './Element';
import * as Node from './Node';
import { document, Document, Node as DomNode, HTMLElement } from '@ephox/dom-globals';
Expand All @@ -15,9 +14,9 @@ const inBody = function (element: Element<DomNode>) {
return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(dom);
};

const body: () => Element<HTMLElement> = Thunk.cached(function () {
const body: () => Element<HTMLElement> = function () {
return getBody(Element.fromDom(document));
});
};

const getBody = function (doc: Element<Document>) {
const b = doc.dom().body;
Expand Down

0 comments on commit 70adc2e

Please sign in to comment.