From ef4314bfa7f8dfd3f4964a442f74cc5cbb0b3508 Mon Sep 17 00:00:00 2001 From: Onoshko Dan Date: Thu, 14 Jan 2016 14:16:29 +0500 Subject: [PATCH] Throw error if call in node --- Sortable.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sortable.js b/Sortable.js index 75365d7..d271999 100644 --- a/Sortable.js +++ b/Sortable.js @@ -23,6 +23,12 @@ } })(function () { "use strict"; + + if (typeof window == "undefined" || typeof window.document == "undefined") { + return function() { + throw new Error( "Sortable.js requires a window with a document" ); + } + } var dragEl, parentEl,