Skip to content

Commit

Permalink
Makes Drag & Drop SSR compatible #21
Browse files Browse the repository at this point in the history
  • Loading branch information
zenorocha committed Feb 17, 2018
1 parent f15921c commit a30be9d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/metal-drag-drop/src/Drag.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

import {core, object} from 'metal';
import {core, object, isServerSide} from 'metal';
import dom from 'metal-dom';
import DragAutoScroll from './helpers/DragAutoScroll';
import DragScrollDelta from './helpers/DragScrollDelta';
Expand All @@ -21,6 +21,10 @@ class Drag extends State {
constructor(config) {
super(config);

if (isServerSide()) {
return;
}

/**
* The drag placeholder that is active at the moment.
* @type {Element}
Expand Down Expand Up @@ -866,7 +870,11 @@ Drag.STATE = {
container: {
setter: dom.toElement,
validator: 'validateElementOrString_',
value: document,
valueFn: function() {
if (!isServerSide()) {
return document;
}
},
},

/**
Expand Down

0 comments on commit a30be9d

Please sign in to comment.