From 1be46d0663be6b1faff4a99be8562e17fd3e0455 Mon Sep 17 00:00:00 2001 From: Lebedev Konstantin Date: Thu, 17 Dec 2015 19:15:18 +0300 Subject: [PATCH 1/5] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34ff6cd..71bf611 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ ### Issue 1. Try [dev](https://github.com/RubaXa/Sortable/tree/dev/)-branch, perhaps the problem has been solved; - 2. [Use the search](https://github.com/RubaXa/Sortable/search?q=problem), maybe already have an answer; + 2. [Use the search](https://github.com/RubaXa/Sortable/search?type=Issues&q=problem), maybe already have an answer; 3. If not found, create example on [jsbin.com (draft)](http://jsbin.com/zunibaxada/1/edit?html,js,output) and describe the problem. --- From ef4314bfa7f8dfd3f4964a442f74cc5cbb0b3508 Mon Sep 17 00:00:00 2001 From: Onoshko Dan Date: Thu, 14 Jan 2016 14:16:29 +0500 Subject: [PATCH 2/5] 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, From 025fd97865df3efcd9df4148468067ad4e4b2b2b Mon Sep 17 00:00:00 2001 From: Pete Miller Date: Sun, 17 Jan 2016 17:15:40 -0800 Subject: [PATCH 3/5] knockout-sortable - use global dependencies if available, then fallback to require / AMD --- knockout-sortable.js | 60 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/knockout-sortable.js b/knockout-sortable.js index dac7f6f..dcb470a 100644 --- a/knockout-sortable.js +++ b/knockout-sortable.js @@ -1,16 +1,54 @@ (function (factory) { "use strict"; - if (typeof define === "function" && define.amd) { - // AMD anonymous module - define(["knockout", "./Sortable"], factory); - } else if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { - // CommonJS module - var ko = require("knockout"); - var Sortable = require('./Sortable'); - factory(ko, Sortable); - } else { - // No module loader (plain