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. --- diff --git a/README.md b/README.md index 09a8177..abe81d9 100644 --- a/README.md +++ b/README.md @@ -283,9 +283,9 @@ Sortable.create(list, { #### `forceFallback` option If set to `true`, the Fallback for non HTML5 Browser will be used, even if we are using an HTML5 Browser. -This gives us the possiblity to test the behaviour for older Browsers even in newer Browser, or make the Drag 'n Drop feel more consistent between Desktop , Mobile and old Browsers. +This gives us the possibility to test the behaviour for older Browsers even in newer Browser, or make the Drag 'n Drop feel more consistent between Desktop , Mobile and old Browsers. -On top of that, the Fallback always generates a copy of that DOM Element and appends the class `fallbackClass` definied in the options. This behaviour controls the look of this 'dragged' Element. +On top of that, the Fallback always generates a copy of that DOM Element and appends the class `fallbackClass` defined in the options. This behaviour controls the look of this 'dragged' Element. Demo: http://jsbin.com/pucurizace/edit?html,css,js,output @@ -689,7 +689,7 @@ Please, [read this](CONTRIBUTING.md). ## MIT LICENSE -Copyright 2013-2015 Lebedev Konstantin +Copyright 2013-2016 Lebedev Konstantin http://rubaxa.github.io/Sortable/ Permission is hereby granted, free of charge, to any person obtaining 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, 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