Skip to content

Commit

Permalink
Merge pull request clauderic#39 from naturalatlas/bugfix-serverside-w…
Browse files Browse the repository at this point in the history
…indow

Bugfix: fixed server-side rendering (window undefined)
  • Loading branch information
Claudéric Demers authored Aug 10, 2016
2 parents 7ed3659 + 44bd27d commit f2066b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/SortableContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function SortableContainer(WrappedComponent, config = {withRef: f
pressDelay: 0,
useWindowAsScrollContainer: false,
hideSortableGhost: true,
contentWindow: window,
contentWindow: typeof window !== 'undefined' ? window : null,
lockToContainerEdges: false,
lockOffset: '50%'
};
Expand Down
1 change: 1 addition & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const events = {
};

export const vendorPrefix = (function () {
if (typeof window === 'undefined') return ''; // server environment
let styles = window.getComputedStyle(document.documentElement, '');
let pre = (Array.prototype.slice
.call(styles)
Expand Down

0 comments on commit f2066b0

Please sign in to comment.