diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-11 17:37:06 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-11 17:37:06 +0100 |
commit | bf7703f5915c6154937f3febf812aad6483bff45 (patch) | |
tree | 384be2f9fff05e755669b14f2f8fa0a624dacf45 /src/modules | |
parent | f2513baf3c9262190ee2c92fb98b2dd099bfbab2 (diff) | |
download | svg.js-bf7703f5915c6154937f3febf812aad6483bff45.tar.gz svg.js-bf7703f5915c6154937f3febf812aad6483bff45.zip |
make window and document exchangeable in case they are not globals alreay, make sure that init functions are chaninable
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/core/event.js | 3 | ||||
-rw-r--r-- | src/modules/core/parser.js | 3 | ||||
-rw-r--r-- | src/modules/core/selector.js | 3 | ||||
-rw-r--r-- | src/modules/core/textable.js | 4 |
4 files changed, 13 insertions, 0 deletions
diff --git a/src/modules/core/event.js b/src/modules/core/event.js index 2fcaf58..351fe3f 100644 --- a/src/modules/core/event.js +++ b/src/modules/core/event.js @@ -1,5 +1,8 @@ import { delimiter } from './regex.js' import { makeInstance } from '../../utils/adopter.js' +import globals from '../../utils/window.js' + +const { window } = globals let listenerId = 0 diff --git a/src/modules/core/parser.js b/src/modules/core/parser.js index 7a656ef..a490576 100644 --- a/src/modules/core/parser.js +++ b/src/modules/core/parser.js @@ -1,4 +1,7 @@ import Doc from '../../elements/Doc.js' +import globals from '../../utils/window.js' + +const { document } = globals export default function parser () { // Reuse cached element if possible diff --git a/src/modules/core/selector.js b/src/modules/core/selector.js index 1e0b55e..52a7ad1 100644 --- a/src/modules/core/selector.js +++ b/src/modules/core/selector.js @@ -1,6 +1,9 @@ import { adopt } from '../../utils/adopter.js' import { map } from '../../utils/utils.js' import { registerMethods } from '../../utils/methods.js' +import globals from '../../utils/window.js' + +const { document } = globals export default function baseFind (query, parent) { return map((parent || document).querySelectorAll(query), function (node) { diff --git a/src/modules/core/textable.js b/src/modules/core/textable.js index 139d056..cf452c6 100644 --- a/src/modules/core/textable.js +++ b/src/modules/core/textable.js @@ -1,3 +1,7 @@ +import globals from '../../utils/window.js' + +const { document } = globals + // Create plain text node export function plain (text) { // clear if build mode is disabled |