\n\t\t * \t \n\t\t * \t );\n\t\t * \t }\n\t\t * \t});\n\t\t * ```\n\t\t */\n\t\tzIndex: React.PropTypes.number,\n\n\t\t/**\n\t\t * Called when dragging starts.\n\t\t *\n\t\t * Example:\n\t\t *\n\t\t * ```js\n\t\t *\tfunction (event, ui) {}\n\t\t * ```\n\t\t *\n\t\t * `event` is the Event that was triggered.\n\t\t * `ui` is an object:\n\t\t *\n\t\t * ```js\n\t\t *\t{\n\t\t *\t\tposition: {top: 0, left: 0}\n\t\t *\t}\n\t\t * ```\n\t\t */\n\t\tonStart: React.PropTypes.func,\n\n\t\t/**\n\t\t * Called while dragging.\n\t\t *\n\t\t * Example:\n\t\t *\n\t\t * ```js\n\t\t *\tfunction (event, ui) {}\n\t\t * ```\n\t\t *\n\t\t * `event` is the Event that was triggered.\n\t\t * `ui` is an object:\n\t\t *\n\t\t * ```js\n\t\t *\t{\n\t\t *\t\tposition: {top: 0, left: 0}\n\t\t *\t}\n\t\t * ```\n\t\t */\n\t\tonDrag: React.PropTypes.func,\n\n\t\t/**\n\t\t * Called when dragging stops.\n\t\t *\n\t\t * Example:\n\t\t *\n\t\t * ```js\n\t\t *\tfunction (event, ui) {}\n\t\t * ```\n\t\t *\n\t\t * `event` is the Event that was triggered.\n\t\t * `ui` is an object:\n\t\t *\n\t\t * ```js\n\t\t *\t{\n\t\t *\t\tposition: {top: 0, left: 0}\n\t\t *\t}\n\t\t * ```\n\t\t */\n\t\tonStop: React.PropTypes.func,\n\n\t\t/**\n\t\t * A workaround option which can be passed if onMouseDown needs to be accessed, since it'll always be blocked (due to that there's internal use of onMouseDown)\n\t\t *\n\t\t */\n\t\tonMouseDown: React.PropTypes.func\n\t},\n\n\tcomponentWillUnmount: function() {\n\t\t// Remove any leftover event handlers\n\t\tremoveEvent(window, 'mousemove', this.handleMouseMove);\n\t\tremoveEvent(window, 'mouseup', this.handleMouseUp);\n\t},\n\n\tgetDefaultProps: function () {\n\t\treturn {\n\t\t\taxis: 'both',\n\t\t\thandle: null,\n\t\t\tcancel: null,\n\t\t\tgrid: null,\n\t\t\tstart: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0\n\t\t\t},\n\t\t\tzIndex: NaN,\n\t\t\tonStart: emptyFunction,\n\t\t\tonDrag: emptyFunction,\n\t\t\tonStop: emptyFunction,\n\t\t\tonMouseDown: emptyFunction\n\t\t};\n\t},\n\n\tgetInitialState: function () {\n\t\treturn {\n\t\t\t// Whether or not currently dragging\n\t\t\tdragging: false,\n\n\t\t\t// Start top/left of this.getDOMNode()\n\t\t\tstartX: 0, startY: 0,\n\n\t\t\t// Offset between start top/left and mouse top/left\n\t\t\toffsetX: 0, offsetY: 0,\n\n\t\t\t// Current top/left of this.getDOMNode()\n\t\t\tclientX: this.props.start.x, clientY: this.props.start.y\n\t\t};\n\t},\n\n\thandleMouseDown: function (e) {\n\t\t// Make it possible to attach event handlers on top of this one\n\t\tthis.props.onMouseDown(e);\n\n\t\tvar node = this.getDOMNode();\n\n\t\t// Short circuit if handle or cancel prop was provided and selector doesn't match\n\t\tif ((this.props.handle && !matchesSelector(e.target, this.props.handle)) ||\n\t\t\t(this.props.cancel && matchesSelector(e.target, this.props.cancel))) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Initiate dragging\n\t\tthis.setState({\n\t\t\tdragging: true,\n\t\t\toffsetX: e.clientX,\n\t\t\toffsetY: e.clientY,\n\t\t\tstartX: parseInt(node.style.left, 10) || 0,\n\t\t\tstartY: parseInt(node.style.top, 10) || 0\n\t\t});\n\n\t\t// Call event handler\n\t\tthis.props.onStart(e, createUIEvent(this));\n\n\t\t// Add event handlers\n\t\taddEvent(window, 'mousemove', this.handleMouseMove);\n\t\taddEvent(window, 'mouseup', this.handleMouseUp);\n\t},\n\n\thandleMouseUp: function (e) {\n\t\t// Short circuit if not currently dragging\n\t\tif (!this.state.dragging) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Turn off dragging\n\t\tthis.setState({\n\t\t\tdragging: false\n\t\t});\n\n\t\t// Call event handler\n\t\tthis.props.onStop(e, createUIEvent(this));\n\n\t\t// Remove event handlers\n\t\tremoveEvent(window, 'mousemove', this.handleMouseMove);\n\t\tremoveEvent(window, 'mouseup', this.handleMouseUp);\n\t},\n\n\thandleMouseMove: function (e) {\n\t\t// Calculate top and left\n\t\tvar clientX = (this.state.startX + (e.clientX - this.state.offsetX));\n\t\tvar clientY = (this.state.startY + (e.clientY - this.state.offsetY));\n\n\t\t// Snap to grid if prop has been provided\n\t\tif (Array.isArray(this.props.grid)) {\n\t\t\tclientX = Math.abs(clientX - this.state.clientX) >= this.props.grid[0]\n\t\t\t\t\t? clientX\n\t\t\t\t\t: this.state.clientX;\n\n\t\t\tclientY = Math.abs(clientY - this.state.clientY) >= this.props.grid[1]\n\t\t\t\t\t? clientY\n\t\t\t\t\t: this.state.clientY;\n\t\t}\n\n\t\t// Update top and left\n\t\tthis.setState({\n\t\t\tclientX: clientX,\n\t\t\tclientY: clientY\n\t\t});\n\n\t\t// Call event handler\n\t\tthis.props.onDrag(e, createUIEvent(this));\n\t},\n\n\trender: function () {\n\t\tvar style = {\n\t\t\t// Set top if vertical drag is enabled\n\t\t\ttop: canDragY(this)\n\t\t\t\t? this.state.clientY\n\t\t\t\t: this.state.startY,\n\n\t\t\t// Set left if horizontal drag is enabled\n\t\t\tleft: canDragX(this)\n\t\t\t\t? this.state.clientX\n\t\t\t\t: this.state.startX\n\t\t};\n\n\t\t// Set zIndex if currently dragging and prop has been provided\n\t\tif (this.state.dragging && !isNaN(this.props.zIndex)) {\n\t\t\tstyle.zIndex = this.props.zIndex;\n\t\t}\n\n\t\t// Reuse the child provided\n\t\t// This makes it flexible to use whatever element is wanted (div, ul, etc)\n\t\treturn React.addons.cloneWithProps(React.Children.only(this.props.children), {\n\t\t\tstyle: style,\n\t\t\tclassName: 'react-draggable',\n\t\t\tonMouseUp: this.handleMouseUp,\n\t\t\tonMouseDown: this.handleMouseDown\n\t\t});\n\t}\n});\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./lib/draggable.js\n ** module id = 1\n ** module chunks = 0\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"React\"\n ** module id = 2\n ** module chunks = 0\n **/","/**\n * Copyright 2013-2014 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule emptyFunction\n */\n\nvar copyProperties = require(\"./copyProperties\");\n\nfunction makeEmptyFunction(arg) {\n return function() {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nfunction emptyFunction() {}\n\ncopyProperties(emptyFunction, {\n thatReturns: makeEmptyFunction,\n thatReturnsFalse: makeEmptyFunction(false),\n thatReturnsTrue: makeEmptyFunction(true),\n thatReturnsNull: makeEmptyFunction(null),\n thatReturnsThis: function() { return this; },\n thatReturnsArgument: function(arg) { return arg; }\n});\n\nmodule.exports = emptyFunction;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/react/lib/emptyFunction.js\n ** module id = 3\n ** module chunks = 0\n **/","/**\n * Copyright 2013-2014 Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * @providesModule copyProperties\n */\n\n/**\n * Copy properties from one or more objects (up to 5) into the first object.\n * This is a shallow copy. It mutates the first object and also returns it.\n *\n * NOTE: `arguments` has a very significant performance penalty, which is why\n * we don't support unlimited arguments.\n */\nfunction copyProperties(obj, a, b, c, d, e, f) {\n obj = obj || {};\n\n if (\"production\" !== process.env.NODE_ENV) {\n if (f) {\n throw new Error('Too many arguments passed to copyProperties');\n }\n }\n\n var args = [a, b, c, d, e];\n var ii = 0, v;\n while (args[ii]) {\n v = args[ii++];\n for (var k in v) {\n obj[k] = v[k];\n }\n\n // IE ignores toString in object iteration.. See:\n // webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html\n if (v.hasOwnProperty && v.hasOwnProperty('toString') &&\n (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) {\n obj.toString = v.toString;\n }\n }\n\n return obj;\n}\n\nmodule.exports = copyProperties;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/react/lib/copyProperties.js\n ** module id = 4\n ** module chunks = 0\n **/","// shim for using process in browser\n\nvar process = module.exports = {};\n\nprocess.nextTick = (function () {\n var canSetImmediate = typeof window !== 'undefined'\n && window.setImmediate;\n var canPost = typeof window !== 'undefined'\n && window.postMessage && window.addEventListener\n ;\n\n if (canSetImmediate) {\n return function (f) { return window.setImmediate(f) };\n }\n\n if (canPost) {\n var queue = [];\n window.addEventListener('message', function (ev) {\n var source = ev.source;\n if ((source === window || source === null) && ev.data === 'process-tick') {\n ev.stopPropagation();\n if (queue.length > 0) {\n var fn = queue.shift();\n fn();\n }\n }\n }, true);\n\n return function nextTick(fn) {\n queue.push(fn);\n window.postMessage('process-tick', '*');\n };\n }\n\n return function nextTick(fn) {\n setTimeout(fn, 0);\n };\n})();\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n}\n\n// TODO(shtylman)\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** (webpack)/~/node-libs-browser/~/process/browser.js\n ** module id = 5\n ** module chunks = 0\n **/"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap f7562d32dfb86b76bff9","webpack:///./index.js","webpack:///./lib/draggable.js","webpack:///external \"React\"","webpack:///./~/react/lib/emptyFunction.js","webpack:///./~/react/lib/copyProperties.js","webpack:///(webpack)/~/node-libs-browser/~/process/browser.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,wC;;;;;;;ACtCA;;;;;;;ACAA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,+DAA8D,YAAY;AAC1E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;;AAEA;AACA;AACA,sCAAqC;;AAErC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA,SAAQ,iBAAiB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAW,QAAQ;AACnB;AACA;AACA,GAAE;AACF;AACA,GAAE;AACF;AACA;AACA;;AAEA;AACA,YAAW,QAAQ;AACnB;AACA;AACA,GAAE;AACF;AACA,GAAE;AACF;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC,cAAc;AACnD,oDAAmD,WAAW;AAC9D;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC,IAAI;AACzC;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA,GAAE;;AAEF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qCAAoC;AACpC;AACA,cAAa;;AAEb;AACA;AACA,IAAG;AACH;AACA,EAAC;;;;;;;ACrcD,gD;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,8CAA6C;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gCAA+B,aAAa,EAAE;AAC9C,uCAAsC,YAAY;AAClD,EAAC;;AAED;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;ACrDA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,8BAA6B;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,4BAA2B;AAC3B;AACA;AACA","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"React\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"React\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactDraggable\"] = factory(require(\"React\"));\n\telse\n\t\troot[\"ReactDraggable\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap f7562d32dfb86b76bff9\n **/","module.exports = require('./lib/draggable');\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./index.js\n ** module id = 0\n ** module chunks = 0\n **/","'use strict';\n\n/** @jsx React.DOM */\nvar React = require('react/addons');\nvar emptyFunction = require('react/lib/emptyFunction');\n\nfunction createUIEvent(draggable) {\n\treturn {\n\t\tposition: {\n\t\t\ttop: draggable.state.clientY,\n\t\t\tleft: draggable.state.clientX\n\t\t}\n\t};\n}\n\nfunction canDragY(draggable) {\n\treturn draggable.props.axis === 'both' ||\n\t\t\tdraggable.props.axis === 'y';\n}\n\nfunction canDragX(draggable) {\n\treturn draggable.props.axis === 'both' ||\n\t\t\tdraggable.props.axis === 'x';\n}\n\nfunction isFunction(func) {\n return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]'\n}\n\n// @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc\nfunction findInArray(array, callback) {\n for (var i = 0, element = array[i], length = array.length; i < length; i++) {\n if (callback.apply(callback, [element, i, array])) return element;\n }\n}\n\nfunction matchesSelector(el, selector) {\n var method = findInArray([\n 'matches',\n 'webkitMatchesSelector',\n 'mozMatchesSelector',\n 'msMatchesSelector',\n 'oMatchesSelector'\n ], function(method){\n return isFunction(el[method]);\n });\n\n return el[method].call(el, selector);\n}\n\n// @credits: http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript/4819886#4819886\nvar isTouchDevice = 'ontouchstart' in window // works on most browsers\n || 'onmsgesturechange' in window; // works on ie10 on ms surface\n\n// look ::handleDragStart\n//function isMultiTouch(e) {\n// return e.touches && Array.isArray(e.touches) && e.touches.length > 1\n//}\n\n/**\n * simple abstraction for dragging events names\n * */\nvar dragEventFor = (function () {\n var eventsFor = {\n touch: {\n start: 'touchstart',\n move: 'touchmove',\n end: 'touchend'\n },\n mouse: {\n start: 'mousedown',\n move: 'mousemove',\n end: 'mouseup'\n }\n };\n return eventsFor[isTouchDevice ? 'touch' : 'mouse'];\n})();\n\n/**\n * get {clientX, clientY} positions of control\n * */\nfunction getControlPosition(e) {\n var position = !isTouchDevice ? e : e.touches[0];\n return {\n clientX: position.clientX,\n clientY: position.clientY\n }\n}\n\nfunction addEvent(el, event, handler) {\n\tif (!el) { return; }\n\tif (el.attachEvent) {\n\t\tel.attachEvent('on' + event, handler);\n\t} else if (el.addEventListener) {\n\t\tel.addEventListener(event, handler, true);\n\t} else {\n\t\tel['on' + event] = handler;\n\t}\n}\n\nfunction removeEvent(el, event, handler) {\n\tif (!el) { return; }\n\tif (el.detachEvent) {\n\t\tel.detachEvent('on' + event, handler);\n\t} else if (el.removeEventListener) {\n\t\tel.removeEventListener(event, handler, true);\n\t} else {\n\t\tel['on' + event] = null;\n\t}\n}\n\nmodule.exports = React.createClass({\n\tdisplayName: 'Draggable',\n\n\tpropTypes: {\n\t\t/**\n\t\t * `axis` determines which axis the draggable can move.\n\t\t *\n\t\t * 'both' allows movement horizontally and vertically.\n\t\t * 'x' limits movement to horizontal axis.\n\t\t * 'y' limits movement to vertical axis.\n\t\t *\n\t\t * Defaults to 'both'.\n\t\t */\n\t\taxis: React.PropTypes.oneOf(['both', 'x', 'y']),\n\n\t\t/**\n\t\t * `handle` specifies a selector to be used as the handle that initiates drag.\n\t\t *\n\t\t * Example:\n\t\t *\n\t\t * ```jsx\n\t\t * \tvar App = React.createClass({\n\t\t * \t render: function () {\n\t\t * \t \treturn (\n\t\t * \t \t \t\n\t\t * \t \t \t
\n\t\t * \t \t \t
Click me to drag
\n\t\t * \t \t \t
This is some other content
\n\t\t * \t \t \t
\n\t\t * \t \t\t\n\t\t * \t \t);\n\t\t * \t }\n\t\t * \t});\n\t\t * ```\n\t\t */\n\t\thandle: React.PropTypes.string,\n\n\t\t/**\n\t\t * `cancel` specifies a selector to be used to prevent drag initialization.\n\t\t *\n\t\t * Example:\n\t\t *\n\t\t * ```jsx\n\t\t * \tvar App = React.createClass({\n\t\t * \t render: function () {\n\t\t * \t return(\n\t\t * \t \n\t\t * \t
\n\t\t * \t \t
You can't drag from here
\n\t\t *\t\t\t\t\t\t
Dragging here works fine
\n\t\t * \t
\n\t\t * \t \n\t\t * \t );\n\t\t * \t }\n\t\t * \t});\n\t\t * ```\n\t\t */\n\t\tcancel: React.PropTypes.string,\n\n\t\t/**\n\t\t * `grid` specifies the x and y that dragging should snap to.\n\t\t *\n\t\t * Example:\n\t\t *\n\t\t * ```jsx\n\t\t * \tvar App = React.createClass({\n\t\t * \t render: function () {\n\t\t * \t return (\n\t\t * \t \n\t\t * \t
I snap to a 25 x 25 grid
\n\t\t * \t \n\t\t * \t );\n\t\t * \t }\n\t\t * \t});\n\t\t * ```\n\t\t */\n\t\tgrid: React.PropTypes.arrayOf(React.PropTypes.number),\n\n\t\t/**\n\t\t * `start` specifies the x and y that the dragged item should start at\n\t\t *\n\t\t * Example:\n\t\t *\n\t\t * ```jsx\n\t\t * \tvar App = React.createClass({\n\t\t * \t render: function () {\n\t\t * \t return (\n\t\t * \t \n\t\t * \t