nativesortable
Advanced tools
Comparing version 0.0.1 to 0.1.0
{ | ||
"name": "nativesortable", | ||
"main": "nativesortable.js", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"homepage": "http://bgrins.github.io/nativesortable", | ||
@@ -6,0 +6,0 @@ "authors": [ |
/** | ||
* nativesortable - v0.0.1 | ||
* nativesortable | ||
* | ||
@@ -31,6 +31,2 @@ * Originally based on code found here: | ||
var CHILD_CLASS = "sortable-child"; | ||
var DRAGGING_CLASS = "sortable-dragging"; | ||
var OVER_CLASS = "sortable-over"; | ||
function hasClassName(el, name) { | ||
@@ -129,2 +125,6 @@ return new RegExp("(?:^|\\s+)" + name + "(?:\\s+|$)").test(el.className); | ||
var CHILD_CLASS = opts.childClass || "sortable-child"; | ||
var DRAGGING_CLASS = opts.draggingClass || "sortable-dragging"; | ||
var OVER_CLASS = opts.overClass || "sortable-over"; | ||
var currentlyDraggingElement = null; | ||
@@ -168,3 +168,2 @@ var currentlyDraggingTarget = null; | ||
var handleDragEnter = delegate(function(e) { | ||
if (!currentlyDraggingElement || currentlyDraggingElement === this) { | ||
@@ -191,3 +190,2 @@ return true; | ||
var handleDragLeave = delegate(function(e) { | ||
// Prevent dragenter on a child from allowing a dragleave on the container | ||
@@ -222,7 +220,6 @@ var previousCounter = dragenterData(this); | ||
} | ||
change(this, currentlyDraggingElement); | ||
}); | ||
var handleDragEnd = function(e) { | ||
change(this,currentlyDraggingElement); | ||
@@ -244,3 +241,2 @@ currentlyDraggingElement = null; | ||
var handleTouchMove = delegate(function(e) { | ||
if (!currentlyDraggingElement || | ||
@@ -247,0 +243,0 @@ currentlyDraggingElement === this || |
{ | ||
"name": "nativesortable", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "use native drag and drop APIs to provide sortable items", | ||
@@ -5,0 +5,0 @@ "main": "nativesortable.js", |
@@ -9,5 +9,18 @@ An implementation of HTML5 Drag and Drop API to provide a sortable list of items. | ||
var list = document.getElementByID("list"); | ||
nativesortable(list, { change: onchange }); | ||
var list = document.getElementById("list"); | ||
nativesortable(list, { | ||
change: onchange, | ||
childClass: "sortable-child", | ||
draggingClass: "sortable-dragging", | ||
overClass: "sortable-over" | ||
}); | ||
## Package Management | ||
bower install nativesortable | ||
- or - | ||
npm install nativesortable | ||
## Extra CSS | ||
I would also recommend adding the following CSS: | ||
@@ -14,0 +27,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93146
44