From 6e8b670ca35a055b41b89f7e23f26c993ce5e622 Mon Sep 17 00:00:00 2001 From: Chris Trevino Date: Mon, 16 Jan 2017 22:54:02 -0800 Subject: [PATCH 1/2] Add a context property to the DragDropManager. This will help to eliminate the dependency on 'window' in the HTML5 backend --- src/DragDropManager.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/DragDropManager.js b/src/DragDropManager.js index 05d729b..ce2a4df 100644 --- a/src/DragDropManager.js +++ b/src/DragDropManager.js @@ -5,9 +5,9 @@ import DragDropMonitor from './DragDropMonitor'; import HandlerRegistry from './HandlerRegistry'; export default class DragDropManager { - constructor(createBackend) { + constructor(createBackend, context = (global || window)) { const store = createStore(reducer); - + this.context = context; this.store = store; this.monitor = new DragDropMonitor(store); this.registry = this.monitor.registry; @@ -27,6 +27,10 @@ export default class DragDropManager { } } + getContext() { + return this.context; + } + getMonitor() { return this.monitor; } From 1dfcd64c80eaad0b2b7186b8c9f412ea62c2876e Mon Sep 17 00:00:00 2001 From: Chris Trevino Date: Wed, 25 Jan 2017 14:05:49 -0800 Subject: [PATCH 2/2] Update the context argument to DragDropManager to default to an empty object --- src/DragDropManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DragDropManager.js b/src/DragDropManager.js index f0c8a55..1026221 100644 --- a/src/DragDropManager.js +++ b/src/DragDropManager.js @@ -4,7 +4,7 @@ import * as dragDropActions from './actions/dragDrop'; import DragDropMonitor from './DragDropMonitor'; export default class DragDropManager { - constructor(createBackend, context = (global || window)) { + constructor(createBackend, context = {}) { const store = createStore(reducer); this.context = context; this.store = store;