It doesn't do a lot.
require "knead" # only if using knead-spade.js
knead.monitor(draggable, distance: 50)
# distance: default 0
# Minimum distance required to consider a drag has happened.
# All the knead:* events have the following properties:
# startX, startY, deltaX, deltaY
# They are in pixel values and are relative to the document 0,0 point.
draggable.bind "knead:dragstart", (event) ->
# Setup
dragstart.bind "knead:drag", (event) ->
# Dostuff
dragstart.bind "knead:dragend" (event) ->
# Teardown
knead.monitor("html", distance: 50)
$("#container .draggable").live "knead:dragstart", (event) ->
rake dist
You'll find three distributions in dist/
- knead.js - Full development build
- knead-spade.js - Build registered for minispade
- knead-min.js - uglified build
rake test
You'll need to have phantomjs installed. This has been known to do the trick:
brew install phantomjs
- added touch event handlers for touchstart, touchmove and touchend
- updated event handers to track indivdual touches simultaneously
- changed event listener code to work when called across iframe boundary
- fixed bug when monitoring non-existant elements
- fixed bug when script is monitoring drag across documents
- packaged as html_package
- automated github upload
- switched to qunit/phantomjs
- using rake-pipeline and building minispade distribution
- no longer an npm package
- have mouseup listener return true as to not interfere with outher libraries listening to the events
- Fixed bug where knead:dragstart would fire although the drag should have been canceled altogether.
- Fixed bug where knead:dragend would fire although a proper drag had not started.
- Added ability to use .live to delegate knead events.
- Added knead.initialize. This is needed to start things up to allow for delegation on a document-wide scale.
- Released before institution of changelog.