From 0043e4796ec57f4892e0f5d9eebe0d8e88a87454 Mon Sep 17 00:00:00 2001 From: RubaXa Date: Wed, 16 Sep 2015 10:18:34 +0300 Subject: [PATCH] #558: + Error initializing --- Sortable.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sortable.js b/Sortable.js index 6f5c9c9..438dcf0 100644 --- a/Sortable.js +++ b/Sortable.js @@ -172,6 +172,10 @@ * @param {Object} [options] */ function Sortable(el, options) { + if (!(el && el.nodeType && el.nodeType === 1)) { + throw 'Sortable: `el` must be HTMLElement, and not ' + {}.toString.call(el); + } + this.el = el; // root element this.options = options = _extend({}, options);