Browse Source

Merge branch 'master' of github.com:RubaXa/Sortable

pull/793/head
RubaXa 9 years ago
parent
commit
1bf357899b
  1. 2
      CONTRIBUTING.md
  2. 6
      README.md
  3. 6
      Sortable.js
  4. 60
      knockout-sortable.js

2
CONTRIBUTING.md

@ -3,7 +3,7 @@
### Issue ### Issue
1. Try [dev](https://github.com/RubaXa/Sortable/tree/dev/)-branch, perhaps the problem has been solved; 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. 3. If not found, create example on [jsbin.com (draft)](http://jsbin.com/zunibaxada/1/edit?html,js,output) and describe the problem.
--- ---

6
README.md

@ -283,9 +283,9 @@ Sortable.create(list, {
#### `forceFallback` option #### `forceFallback` option
If set to `true`, the Fallback for non HTML5 Browser will be used, even if we are using an HTML5 Browser. 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 Demo: http://jsbin.com/pucurizace/edit?html,css,js,output
@ -689,7 +689,7 @@ Please, [read this](CONTRIBUTING.md).
## MIT LICENSE ## MIT LICENSE
Copyright 2013-2015 Lebedev Konstantin <ibnRubaXa@gmail.com> Copyright 2013-2016 Lebedev Konstantin <ibnRubaXa@gmail.com>
http://rubaxa.github.io/Sortable/ http://rubaxa.github.io/Sortable/
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining

6
Sortable.js

@ -24,6 +24,12 @@
})(function () { })(function () {
"use strict"; "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, var dragEl,
parentEl, parentEl,
ghostEl, ghostEl,

60
knockout-sortable.js

@ -1,16 +1,54 @@
(function (factory) { (function (factory) {
"use strict"; "use strict";
if (typeof define === "function" && define.amd) { //get ko ref via global or require
// AMD anonymous module var koRef;
define(["knockout", "./Sortable"], factory); if (typeof ko !== 'undefined') {
} else if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { //global ref already defined
// CommonJS module koRef = ko;
var ko = require("knockout"); }
var Sortable = require('./Sortable'); else if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {
factory(ko, Sortable); //commonjs / node.js
} else { koRef = require('knockout');
// No module loader (plain <script> tag) - put directly in global namespace }
factory(window.ko, window.Sortable); //get sortable ref via global or require
var sortableRef;
if (typeof Sortable !== 'undefined') {
//global ref already defined
sortableRef = Sortable;
}
else if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {
//commonjs / node.js
sortableRef = require('sortablejs');
}
//use references if we found them
if (koRef !== undefined && sortableRef !== undefined) {
factory(koRef, sortableRef);
}
//if both references aren't found yet, get via AMD if available
else if (typeof define === 'function' && define.amd){
//we may have a reference to only 1, or none
if (koRef !== undefined && sortableRef === undefined) {
define(['./Sortable'], function(amdSortableRef){ factory(koRef, amdSortableRef); });
}
else if (koRef === undefined && sortableRef !== undefined) {
define(['knockout'], function(amdKnockout){ factory(amdKnockout, sortableRef); });
}
else if (koRef === undefined && sortableRef === undefined) {
define(['knockout', './Sortable'], factory);
}
}
//no more routes to get references
else {
//report specific error
if (koRef !== undefined && sortableRef === undefined) {
throw new Error('knockout-sortable could not get reference to Sortable');
}
else if (koRef === undefined && sortableRef !== undefined) {
throw new Error('knockout-sortable could not get reference to Knockout');
}
else if (koRef === undefined && sortableRef === undefined) {
throw new Error('knockout-sortable could not get reference to Knockout or Sortable');
}
} }
})(function (ko, Sortable) { })(function (ko, Sortable) {
"use strict"; "use strict";

Loading…
Cancel
Save