UNPKG

interactjs

Version:

Drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)

1 lines 78.3 kB
[{"comment":"/** @article /home/taye/proj/interact.js/docs/index.md **/","meta":{"filename":"index.md","lineno":1,"columnno":0,"path":"/home/taye/proj/interact.js/docs","code":{},"shortpath":"docs/index.md"},"kind":"article","source":"\n<img\n style=\"background-color: #272822; display: block; margin: auto; max-height: 8em; width: 100%\"\n alt=\"interact.js\"\n src=\"img/ijs-anim-short.svg\">\n","name":"index","filename":"index.md","title":"API Reference","longname":"article:index","description":"<p><img\n style=\"background-color: #272822; display: block; margin: auto; max-height: 8em; width: 100%\"\n alt=\"interact.js\"\n src=\"img/ijs-anim-short.svg\"></p>","outfilename":"index.html","scope":"global","___id":"T000002R002603","___s":true,"attribs":"","id":"index","ancestors":[]},{"comment":"/**\n * ```js\n * interact('#draggable').draggable(true);\n *\n * var rectables = interact('rect');\n * rectables\n * .gesturable(true)\n * .on('gesturemove', function (event) {\n * // ...\n * });\n * ```\n *\n * The methods of this variable can be used to set elements as interactables\n * and also to change various default settings.\n *\n * Calling it as a function and passing an element or a valid CSS selector\n * string returns an Interactable object which has various methods to configure\n * it.\n *\n * @global\n *\n * @param {Element | string} element The HTML or SVG Element to interact with\n * or CSS selector\n * @return {Interactable}\n */","meta":{"range":[970,1228],"filename":"interact.js","lineno":37,"columnno":0,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100013387","name":"interact","type":"FunctionDeclaration","paramnames":["element","options"]},"vars":{"interactable":"module:interact~interactable","interactable.events.global":"module:interact~interactable.events.global"},"shortpath":"src/interact.js"},"description":"<pre class=\"prettyprint source lang-js\"><code>interact('#draggable').draggable(true);\n\nvar rectables = interact('rect');\nrectables\n .gesturable(true)\n .on('gesturemove', function (event) {\n // ...\n });\n</code></pre>\n<p>The methods of this variable can be used to set elements as interactables\nand also to change various default settings.</p>\n<p>Calling it as a function and passing an element or a valid CSS selector\nstring returns an Interactable object which has various methods to configure\nit.</p>","scope":"global","params":[{"type":{"names":["Element","string"]},"description":"<p>The HTML or SVG Element to interact with\nor CSS selector</p>","name":"element"}],"returns":[{"type":{"names":["Interactable"]}}],"name":"interact","longname":"interact","kind":"function","___id":"T000002R001321","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"interact","signature":"<span class=\"signature\">(element)</span><span class=\"type-signature\"> &rarr; {<a href=\"Interactable.html\">Interactable</a>}</span>","ancestors":[]},{"comment":"/** */","meta":{"range":[761,1283],"filename":"Interactable.js","lineno":26,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100001133","name":"Interactable","type":"MethodDefinition","paramnames":["target","options"]},"vars":{"":null},"shortpath":"src/Interactable.js"},"name":"Interactable","longname":"Interactable","kind":"class","scope":"global","params":[],"___id":"T000003R000002","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"Interactable","signature":"<span class=\"signature\">()</span><span class=\"type-signature\"></span>","ancestors":[]},{"comment":"/**\n * ```js\n * interact('.resize-drag')\n * .resizable(true)\n * .draggable(true)\n * .actionChecker(function (pointer, event, action, interactable, element, interaction) {\n *\n * if (interact.matchesSelector(event.target, '.drag-handle') {\n * // force drag with handle target\n * action.name = drag;\n * }\n * else {\n * // resize from the top and right edges\n * action.name = 'resize';\n * action.edges = { top: true, right: true };\n * }\n *\n * return action;\n * });\n * ```\n *\n * Gets or sets the function used to check action to be performed on\n * pointerDown\n *\n * @param {function | null} [checker] A function which takes a pointer event,\n * defaultAction string, interactable, element and interaction as parameters\n * and returns an object with name property 'drag' 'resize' or 'gesture' and\n * optionally an `edges` object with boolean 'top', 'left', 'bottom' and right\n * props.\n * @return {Function | Interactable} The checker function or this Interactable\n */","meta":{"range":[4614,4895],"filename":"InteractableMethods.js","lineno":143,"columnno":0,"path":"/home/taye/proj/interact.js/src/autoStart","code":{"id":"astnode100010205","name":"Interactable.prototype.actionChecker","type":"FunctionExpression","paramnames":["checker"]},"vars":{"this.options.actionChecker":"Interactable#actionChecker#options.actionChecker"},"shortpath":"src/autoStart/InteractableMethods.js"},"description":"<pre class=\"prettyprint source lang-js\"><code>interact('.resize-drag')\n .resizable(true)\n .draggable(true)\n .actionChecker(function (pointer, event, action, interactable, element, interaction) {\n\n if (interact.matchesSelector(event.target, '.drag-handle') {\n // force drag with handle target\n action.name = drag;\n }\n else {\n // resize from the top and right edges\n action.name = 'resize';\n action.edges = { top: true, right: true };\n }\n\n return action;\n});\n</code></pre>\n<p>Gets or sets the function used to check action to be performed on\npointerDown</p>","params":[{"type":{"names":["function","null"]},"optional":true,"description":"<p>A function which takes a pointer event,\ndefaultAction string, interactable, element and interaction as parameters\nand returns an object with name property 'drag' 'resize' or 'gesture' and\noptionally an <code>edges</code> object with boolean 'top', 'left', 'bottom' and right\nprops.</p>","name":"checker"}],"returns":[{"type":{"names":["function","Interactable"]},"description":"<p>The checker function or this Interactable</p>"}],"name":"actionChecker","longname":"Interactable#actionChecker","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R001018","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"actionChecker","signature":"<span class=\"signature\">(checker<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {function|<a href=\"Interactable.html\">Interactable</a>}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * ```js\n *\n * @deprecated\n * A drag/resize/gesture is started only If the target of the `mousedown`,\n * `pointerdown` or `touchstart` event or any of it's parents match the given\n * CSS selector or Element.\n *\n * Don't use this method. Instead set the `allowFrom` option for each action\n * or for `pointerEvents`\n *\n * @example\n * interact(targett)\n * .resizable({\n * allowFrom: '.resize-handle',\n * .pointerEvents({\n * allowFrom: '.handle',,\n * });\n *\n * @param {string | Element | null} [newValue] a CSS selector string, an\n * Element or `null` to allow from any element\n * @return {string | Element | object} The current allowFrom value or this\n * Interactable\n */","meta":{"range":[2359,2582],"filename":"InteractableMethods.js","lineno":75,"columnno":0,"path":"/home/taye/proj/interact.js/src/autoStart","code":{"id":"astnode100010037","name":"Interactable.prototype.allowFrom","type":"CallExpression","value":"","paramnames":[]},"shortpath":"src/autoStart/InteractableMethods.js"},"description":"<pre class=\"prettyprint source lang-js\"><code></code></pre>","deprecated":"A drag/resize/gesture is started only If the target of the `mousedown`,\n`pointerdown` or `touchstart` event or any of it's parents match the given\nCSS selector or Element.\n\nDon't use this method. Instead set the `allowFrom` option for each action\nor for `pointerEvents`","examples":[{"caption":"","code":"interact(targett)\n .resizable({\n allowFrom: '.resize-handle',\n .pointerEvents({\n allowFrom: '.handle',,\n });"}],"params":[{"type":{"names":["string","Element","null"]},"optional":true,"description":"<p>a CSS selector string, an\nElement or <code>null</code> to allow from any element</p>","name":"newValue"}],"returns":[{"type":{"names":["string","Element","object"]},"description":"<p>The current allowFrom value or this\nInteractable</p>"}],"name":"allowFrom","longname":"Interactable#allowFrom","kind":"member","memberof":"Interactable","scope":"instance","___id":"T000002R001014","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"allowFrom","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"],"signature":"<span class=\"type-signature\"></span>"},{"comment":"/**\n * Gets the selector context Node of the Interactable. The default is\n * `window.document`.\n *\n * @return {Node} The context Node of this Interactable\n */","meta":{"range":[5470,5512],"filename":"Interactable.js","lineno":179,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100001664","name":"Interactable#context","type":"MethodDefinition","paramnames":[]},"vars":{"":null},"shortpath":"src/Interactable.js"},"description":"<p>Gets the selector context Node of the Interactable. The default is\n<code>window.document</code>.</p>","returns":[{"type":{"names":["Node"]},"description":"<p>The context Node of this Interactable</p>"}],"name":"context","longname":"Interactable#context","kind":"function","memberof":"Interactable","scope":"instance","params":[],"___id":"T000002R000176","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"context","signature":"<span class=\"signature\">()</span><span class=\"type-signature\"> &rarr; {Node}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * Returns or sets the mouse coordinate types used to calculate the\n * movement of the pointer.\n *\n * @param {string} [newValue] Use 'client' if you will be scrolling while\n * interacting; Use 'page' if you want autoScroll to work\n * @return {string | object} The current deltaSource or this Interactable\n */","meta":{"range":[5104,5295],"filename":"Interactable.js","lineno":163,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100001634","name":"Interactable#deltaSource","type":"MethodDefinition","paramnames":["newValue"]},"vars":{"":null},"shortpath":"src/Interactable.js"},"description":"<p>Returns or sets the mouse coordinate types used to calculate the\nmovement of the pointer.</p>","params":[{"type":{"names":["string"]},"optional":true,"description":"<p>Use 'client' if you will be scrolling while\ninteracting; Use 'page' if you want autoScroll to work</p>","name":"newValue"}],"returns":[{"type":{"names":["string","object"]},"description":"<p>The current deltaSource or this Interactable</p>"}],"name":"deltaSource","longname":"Interactable#deltaSource","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R000174","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"deltaSource","signature":"<span class=\"signature\">(newValue<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {string|object}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * ```js\n * interact(element).draggable({\n * onstart: function (event) {},\n * onmove : function (event) {},\n * onend : function (event) {},\n *\n * // the axis in which the first movement must be\n * // for the drag sequence to start\n * // 'xy' by default - any direction\n * startAxis: 'x' || 'y' || 'xy',\n *\n * // 'xy' by default - don't restrict to one axis (move in any direction)\n * // 'x' or 'y' to restrict movement to either axis\n * // 'start' to restrict movement to the axis the drag started in\n * lockAxis: 'x' || 'y' || 'xy' || 'start',\n *\n * // max number of drags that can happen concurrently\n * // with elements of this Interactable. Infinity by default\n * max: Infinity,\n *\n * // max number of drags that can target the same element+Interactable\n * // 1 by default\n * maxPerElement: 2\n * });\n *\n * var isDraggable = interact('element').draggable(); // true\n * ```\n *\n * Get or set whether drag actions can be performed on the target\n *\n * @param {boolean | object} [options] true/false or An object with event\n * listeners to be fired on drag events (object makes the Interactable\n * draggable)\n * @return {boolean | Interactable} boolean indicating if this can be the\n * target of drag events, or this Interctable\n */","meta":{"range":[3787,4492],"filename":"drag.js","lineno":119,"columnno":0,"path":"/home/taye/proj/interact.js/src/actions","code":{"id":"astnode100004852","name":"Interactable.prototype.draggable","type":"FunctionExpression","paramnames":["options"]},"vars":{"this.options.drag.enabled":"Interactable#draggable#options.drag.enabled","this.options.drag.lockAxis":"Interactable#draggable#options.drag.lockAxis","this.options.drag.startAxis":"Interactable#draggable#options.drag.startAxis","this.ondragstart":"Interactable#draggable#ondragstart","this.ondragend":"Interactable#draggable#ondragend"},"shortpath":"src/actions/drag.js"},"description":"<pre class=\"prettyprint source lang-js\"><code>interact(element).draggable({\n onstart: function (event) {},\n onmove : function (event) {},\n onend : function (event) {},\n\n // the axis in which the first movement must be\n // for the drag sequence to start\n // 'xy' by default - any direction\n startAxis: 'x' || 'y' || 'xy',\n\n // 'xy' by default - don't restrict to one axis (move in any direction)\n // 'x' or 'y' to restrict movement to either axis\n // 'start' to restrict movement to the axis the drag started in\n lockAxis: 'x' || 'y' || 'xy' || 'start',\n\n // max number of drags that can happen concurrently\n // with elements of this Interactable. Infinity by default\n max: Infinity,\n\n // max number of drags that can target the same element+Interactable\n // 1 by default\n maxPerElement: 2\n});\n\nvar isDraggable = interact('element').draggable(); // true\n</code></pre>\n<p>Get or set whether drag actions can be performed on the target</p>","params":[{"type":{"names":["boolean","object"]},"optional":true,"description":"<p>true/false or An object with event\nlisteners to be fired on drag events (object makes the Interactable\ndraggable)</p>","name":"options"}],"returns":[{"type":{"names":["boolean","Interactable"]},"description":"<p>boolean indicating if this can be the\ntarget of drag events, or this Interctable</p>"}],"name":"draggable","longname":"Interactable#draggable","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R000501","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"draggable","signature":"<span class=\"signature\">(options<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {boolean|<a href=\"Interactable.html\">Interactable</a>}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * ```js\n * interact(target)\n * .dropChecker(function(dragEvent, // related dragmove or dragend event\n * event, // TouchEvent/PointerEvent/MouseEvent\n * dropped, // bool result of the default checker\n * dropzone, // dropzone Interactable\n * dropElement, // dropzone elemnt\n * draggable, // draggable Interactable\n * draggableElement) {// draggable element\n *\n * return dropped && event.target.hasAttribute('allow-drop');\n * }\n * ```\n *\n * ```js\n * interact('.drop').dropzone({\n * accept: '.can-drop' || document.getElementById('single-drop'),\n * overlap: 'pointer' || 'center' || zeroToOne\n * }\n * ```\n *\n * Returns or sets whether draggables can be dropped onto this target to\n * trigger drop events\n *\n * Dropzones can receive the following events:\n * - `dropactivate` and `dropdeactivate` when an acceptable drag starts and ends\n * - `dragenter` and `dragleave` when a draggable enters and leaves the dropzone\n * - `dragmove` when a draggable that has entered the dropzone is moved\n * - `drop` when a draggable is dropped into this dropzone\n *\n * Use the `accept` option to allow only elements that match the given CSS\n * selector or element. The value can be:\n *\n * - **an Element** - only that element can be dropped into this dropzone.\n * - **a string**, - the element being dragged must match it as a CSS selector.\n * - **`null`** - accept options is cleared - it accepts any element.\n *\n * Use the `overlap` option to set how drops are checked for. The allowed\n * values are:\n *\n * - `'pointer'`, the pointer must be over the dropzone (default)\n * - `'center'`, the draggable element's center must be over the dropzone\n * - a number from 0-1 which is the `(intersection area) / (draggable area)`.\n * e.g. `0.5` for drop to happen when half of the area of the draggable is\n * over the dropzone\n *\n * Use the `checker` option to specify a function to check if a dragged element\n * is over this Interactable.\n *\n * @param {boolean | object | null} [options] The new options to be set.\n * @return {boolean | Interactable} The current setting or this Interactable\n */","meta":{"range":[10642,12201],"filename":"drop.js","lineno":327,"columnno":0,"path":"/home/taye/proj/interact.js/src/actions","code":{"id":"astnode100006148","name":"Interactable.prototype.dropzone","type":"FunctionExpression","paramnames":["options"]},"vars":{"this.options.drop.enabled":"Interactable#dropzone#options.drop.enabled","this.events.ondrop":"Interactable#dropzone#events.ondrop","this.events.ondropactivate":"Interactable#dropzone#events.ondropactivate","this.events.ondropdeactivate":"Interactable#dropzone#events.ondropdeactivate","this.events.ondragenter":"Interactable#dropzone#events.ondragenter","this.events.ondragleave":"Interactable#dropzone#events.ondragleave","this.events.ondropmove":"Interactable#dropzone#events.ondropmove","this.options.drop.overlap":"Interactable#dropzone#options.drop.overlap","this.options.drop.accept":"Interactable#dropzone#options.drop.accept","this.options.drop.checker":"Interactable#dropzone#options.drop.checker","this.ondragenter":"Interactable#dropzone#ondragenter","this.ondragleave":"Interactable#dropzone#ondragleave","this.ondrop":"Interactable#dropzone#ondrop","this.ondropactivate":"Interactable#dropzone#ondropactivate","this.ondropdeactivate":"Interactable#dropzone#ondropdeactivate"},"shortpath":"src/actions/drop.js"},"description":"<pre class=\"prettyprint source lang-js\"><code>interact(target)\n.dropChecker(function(dragEvent, // related dragmove or dragend event\n event, // TouchEvent/PointerEvent/MouseEvent\n dropped, // bool result of the default checker\n dropzone, // dropzone Interactable\n dropElement, // dropzone elemnt\n draggable, // draggable Interactable\n draggableElement) {// draggable element\n\n return dropped && event.target.hasAttribute('allow-drop');\n}\n</code></pre>\n<pre class=\"prettyprint source lang-js\"><code>interact('.drop').dropzone({\n accept: '.can-drop' || document.getElementById('single-drop'),\n overlap: 'pointer' || 'center' || zeroToOne\n}\n</code></pre>\n<p>Returns or sets whether draggables can be dropped onto this target to\ntrigger drop events</p>\n<p>Dropzones can receive the following events:</p>\n<ul>\n<li><code>dropactivate</code> and <code>dropdeactivate</code> when an acceptable drag starts and ends</li>\n<li><code>dragenter</code> and <code>dragleave</code> when a draggable enters and leaves the dropzone</li>\n<li><code>dragmove</code> when a draggable that has entered the dropzone is moved</li>\n<li><code>drop</code> when a draggable is dropped into this dropzone</li>\n</ul>\n<p>Use the <code>accept</code> option to allow only elements that match the given CSS\nselector or element. The value can be:</p>\n<ul>\n<li><strong>an Element</strong> - only that element can be dropped into this dropzone.</li>\n<li><strong>a string</strong>, - the element being dragged must match it as a CSS selector.</li>\n<li><strong><code>null</code></strong> - accept options is cleared - it accepts any element.</li>\n</ul>\n<p>Use the <code>overlap</code> option to set how drops are checked for. The allowed\nvalues are:</p>\n<ul>\n<li><code>'pointer'</code>, the pointer must be over the dropzone (default)</li>\n<li><code>'center'</code>, the draggable element's center must be over the dropzone</li>\n<li>a number from 0-1 which is the <code>(intersection area) / (draggable area)</code>.\ne.g. <code>0.5</code> for drop to happen when half of the area of the draggable is\nover the dropzone</li>\n</ul>\n<p>Use the <code>checker</code> option to specify a function to check if a dragged element\nis over this Interactable.</p>","params":[{"type":{"names":["boolean","object","null"]},"optional":true,"description":"<p>The new options to be set.</p>","name":"options"}],"returns":[{"type":{"names":["boolean","Interactable"]},"description":"<p>The current setting or this Interactable</p>"}],"name":"dropzone","longname":"Interactable#dropzone","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R000641","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"dropzone","signature":"<span class=\"signature\">(options<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {boolean|<a href=\"Interactable.html\">Interactable</a>}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * Calls listeners for the given InteractEvent type bound globally\n * and directly to this Interactable\n *\n * @param {InteractEvent} iEvent The InteractEvent object to be fired on this\n * Interactable\n * @return {Interactable} this Interactable\n */","meta":{"range":[5920,5987],"filename":"Interactable.js","lineno":196,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100001692","name":"Interactable#fire","type":"MethodDefinition","paramnames":["iEvent"]},"vars":{"":null},"shortpath":"src/Interactable.js"},"description":"<p>Calls listeners for the given InteractEvent type bound globally\nand directly to this Interactable</p>","params":[{"type":{"names":["InteractEvent"]},"description":"<p>The InteractEvent object to be fired on this\nInteractable</p>","name":"iEvent"}],"returns":[{"type":{"names":["Interactable"]},"description":"<p>this Interactable</p>"}],"name":"fire","longname":"Interactable#fire","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R000178","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"fire","signature":"<span class=\"signature\">(iEvent)</span><span class=\"type-signature\"> &rarr; {<a href=\"Interactable.html\">Interactable</a>}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * ```js\n * interact(element).gesturable({\n * onstart: function (event) {},\n * onmove : function (event) {},\n * onend : function (event) {},\n *\n * // limit multiple gestures.\n * // See the explanation in {@link Interactable.draggable} example\n * max: Infinity,\n * maxPerElement: 1,\n * });\n *\n * var isGestureable = interact(element).gesturable();\n * ```\n *\n * Gets or sets whether multitouch gestures can be performed on the target\n *\n * @param {boolean | object} [options] true/false or An object with event\n * listeners to be fired on gesture events (makes the Interactable gesturable)\n * @return {boolean | Interactable} A boolean indicating if this can be the\n * target of gesture events, or this Interactable\n */","meta":{"range":[2228,2736],"filename":"gesture.js","lineno":79,"columnno":0,"path":"/home/taye/proj/interact.js/src/actions","code":{"id":"astnode100007200","name":"Interactable.prototype.gesturable","type":"FunctionExpression","paramnames":["options"]},"vars":{"this.options.gesture.enabled":"Interactable#gesturable#options.gesture.enabled","this.ongesturestart":"Interactable#gesturable#ongesturestart","this.ongestureend":"Interactable#gesturable#ongestureend"},"shortpath":"src/actions/gesture.js"},"description":"<pre class=\"prettyprint source lang-js\"><code>interact(element).gesturable({\n onstart: function (event) {},\n onmove : function (event) {},\n onend : function (event) {},\n\n // limit multiple gestures.\n // See the explanation in {@link Interactable.draggable} example\n max: Infinity,\n maxPerElement: 1,\n});\n\nvar isGestureable = interact(element).gesturable();\n</code></pre>\n<p>Gets or sets whether multitouch gestures can be performed on the target</p>","params":[{"type":{"names":["boolean","object"]},"optional":true,"description":"<p>true/false or An object with event\nlisteners to be fired on gesture events (makes the Interactable gesturable)</p>","name":"options"}],"returns":[{"type":{"names":["boolean","Interactable"]},"description":"<p>A boolean indicating if this can be the\ntarget of gesture events, or this Interactable</p>"}],"name":"gesturable","longname":"Interactable#gesturable","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R000726","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"gesturable","signature":"<span class=\"signature\">(options<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {boolean|<a href=\"Interactable.html\">Interactable</a>}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * The default function to get an Interactables bounding rect. Can be\n * overridden using {@link Interactable.rectChecker}.\n *\n * @param {Element} [element] The element to measure.\n * @return {object} The object's bounding rectangle.\n */","meta":{"range":[3179,3402],"filename":"Interactable.js","lineno":93,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100001488","name":"Interactable#getRect","type":"MethodDefinition","paramnames":["element"]},"vars":{"":null},"shortpath":"src/Interactable.js"},"description":"<p>The default function to get an Interactables bounding rect. Can be\noverridden using {@link Interactable.rectChecker}.</p>","params":[{"type":{"names":["Element"]},"optional":true,"description":"<p>The element to measure.</p>","name":"element"}],"returns":[{"type":{"names":["object"]},"description":"<p>The object's bounding rectangle.</p>"}],"name":"getRect","longname":"Interactable#getRect","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R000164","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"getRect","signature":"<span class=\"signature\">(element<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {object}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * ```js\n * interact(element, { ignoreFrom: document.getElementById('no-action') });\n * // or\n * interact(element).ignoreFrom('input, textarea, a');\n * ```\n * @deprecated\n * If the target of the `mousedown`, `pointerdown` or `touchstart` event or any\n * of it's parents match the given CSS selector or Element, no\n * drag/resize/gesture is started.\n *\n * Don't use this method. Instead set the `ignoreFrom` option for each action\n * or for `pointerEvents`\n *\n * @example\n * interact(targett)\n * .draggable({\n * ignoreFrom: 'input, textarea, a[href]'',\n * })\n * .pointerEvents({\n * ignoreFrom: '[no-pointer]',\n * });\n *\n * @param {string | Element | null} [newValue] a CSS selector string, an\n * Element or `null` to not ignore any elements\n * @return {string | Element | object} The current ignoreFrom value or this\n * Interactable\n */","meta":{"range":[1442,1669],"filename":"InteractableMethods.js","lineno":47,"columnno":0,"path":"/home/taye/proj/interact.js/src/autoStart","code":{"id":"astnode100010017","name":"Interactable.prototype.ignoreFrom","type":"CallExpression","value":"","paramnames":[]},"shortpath":"src/autoStart/InteractableMethods.js"},"description":"<pre class=\"prettyprint source lang-js\"><code>interact(element, { ignoreFrom: document.getElementById('no-action') });\n// or\ninteract(element).ignoreFrom('input, textarea, a');\n</code></pre>","deprecated":"If the target of the `mousedown`, `pointerdown` or `touchstart` event or any\nof it's parents match the given CSS selector or Element, no\ndrag/resize/gesture is started.\n\nDon't use this method. Instead set the `ignoreFrom` option for each action\nor for `pointerEvents`","examples":[{"caption":"","code":"interact(targett)\n .draggable({\n ignoreFrom: 'input, textarea, a[href]'',\n })\n .pointerEvents({\n ignoreFrom: '[no-pointer]',\n });"}],"params":[{"type":{"names":["string","Element","null"]},"optional":true,"description":"<p>a CSS selector string, an\nElement or <code>null</code> to not ignore any elements</p>","name":"newValue"}],"returns":[{"type":{"names":["string","Element","object"]},"description":"<p>The current ignoreFrom value or this\nInteractable</p>"}],"name":"ignoreFrom","longname":"Interactable#ignoreFrom","kind":"member","memberof":"Interactable","scope":"instance","___id":"T000002R001013","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"ignoreFrom","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"],"signature":"<span class=\"type-signature\"></span>"},{"comment":"/**\n * Removes an InteractEvent, pointerEvent or DOM event listener\n *\n * @param {string | array | object} eventType The types of events that were\n * listened for\n * @param {function} listener The listener function to be removed\n * @param {object | boolean} [options] options object or useCapture flag for\n * removeEventListener\n * @return {object} This Interactable\n */","meta":{"range":[7813,8459],"filename":"Interactable.js","lineno":265,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100001872","name":"Interactable#off","type":"MethodDefinition","paramnames":["eventType","listener","options"]},"vars":{"":null},"shortpath":"src/Interactable.js"},"description":"<p>Removes an InteractEvent, pointerEvent or DOM event listener</p>","params":[{"type":{"names":["string","array","object"]},"description":"<p>The types of events that were\nlistened for</p>","name":"eventType"},{"type":{"names":["function"]},"description":"<p>The listener function to be removed</p>","name":"listener"},{"type":{"names":["object","boolean"]},"optional":true,"description":"<p>options object or useCapture flag for\nremoveEventListener</p>","name":"options"}],"returns":[{"type":{"names":["object"]},"description":"<p>This Interactable</p>"}],"name":"off","longname":"Interactable#off","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R000185","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"off","signature":"<span class=\"signature\">(eventType, listener, options<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {object}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * Binds a listener for an InteractEvent, pointerEvent or DOM event.\n *\n * @param {string | array | object} eventType The types of events to listen\n * for\n * @param {function} listener The function event (s)\n * @param {object | boolean} [options] options object or useCapture flag\n * for addEventListener\n * @return {object} This Interactable\n */","meta":{"range":[6860,7418],"filename":"Interactable.js","lineno":234,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100001790","name":"Interactable#on","type":"MethodDefinition","paramnames":["eventType","listener","options"]},"vars":{"":null},"shortpath":"src/Interactable.js"},"description":"<p>Binds a listener for an InteractEvent, pointerEvent or DOM event.</p>","params":[{"type":{"names":["string","array","object"]},"description":"<p>The types of events to listen\nfor</p>","name":"eventType"},{"type":{"names":["function"]},"description":"<p>The function event (s)</p>","name":"listener"},{"type":{"names":["object","boolean"]},"optional":true,"description":"<p>options object or useCapture flag\nfor addEventListener</p>","name":"options"}],"returns":[{"type":{"names":["object"]},"description":"<p>This Interactable</p>"}],"name":"on","longname":"Interactable#on","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R000183","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"on","signature":"<span class=\"signature\">(eventType, listener, options<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {object}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * Gets or sets the origin of the Interactable's element. The x and y\n * of the origin will be subtracted from action event coordinates.\n *\n * @param {Element | object | string} [origin] An HTML or SVG Element whose\n * rect will be used, an object eg. { x: 0, y: 0 } or string 'parent', 'self'\n * or any CSS selector\n *\n * @return {object} The current origin or this Interactable\n */","meta":{"range":[4693,4771],"filename":"Interactable.js","lineno":151,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100001622","name":"Interactable#origin","type":"MethodDefinition","paramnames":["newValue"]},"vars":{"":null},"shortpath":"src/Interactable.js"},"description":"<p>Gets or sets the origin of the Interactable's element. The x and y\nof the origin will be subtracted from action event coordinates.</p>","params":[{"type":{"names":["Element","object","string"]},"optional":true,"description":"<p>An HTML or SVG Element whose\nrect will be used, an object eg. { x: 0, y: 0 } or string 'parent', 'self'\nor any CSS selector</p>","name":"origin"}],"returns":[{"type":{"names":["object"]},"description":"<p>The current origin or this Interactable</p>"}],"name":"origin","longname":"Interactable#origin","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R000173","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"origin","signature":"<span class=\"signature\">(origin<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {object}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * Returns or sets whether to prevent the browser's default behaviour in\n * response to pointer events. Can be set to:\n * - `'always'` to always prevent\n * - `'never'` to never prevent\n * - `'auto'` to let interact.js try to determine what would be best\n *\n * @param {string} [newValue] `true`, `false` or `'auto'`\n * @return {string | Interactable} The current setting or this Interactable\n */","meta":{"range":[752,1080],"filename":"interactablePreventDefault.js","lineno":20,"columnno":0,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100013972","name":"Interactable.prototype.preventDefault","type":"FunctionExpression","paramnames":["newValue"]},"vars":{"this.options.preventDefault":"Interactable#preventDefault#options.preventDefault"},"shortpath":"src/interactablePreventDefault.js"},"description":"<p>Returns or sets whether to prevent the browser's default behaviour in\nresponse to pointer events. Can be set to:</p>\n<ul>\n<li><code>'always'</code> to always prevent</li>\n<li><code>'never'</code> to never prevent</li>\n<li><code>'auto'</code> to let interact.js try to determine what would be best</li>\n</ul>","params":[{"type":{"names":["string"]},"optional":true,"description":"<p><code>true</code>, <code>false</code> or <code>'auto'</code></p>","name":"newValue"}],"returns":[{"type":{"names":["string","Interactable"]},"description":"<p>The current setting or this Interactable</p>"}],"name":"preventDefault","longname":"Interactable#preventDefault","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R001365","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"preventDefault","signature":"<span class=\"signature\">(newValue<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {string|<a href=\"Interactable.html\">Interactable</a>}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * Returns or sets the function used to calculate the interactable's\n * element's rectangle\n *\n * @param {function} [checker] A function which returns this Interactable's\n * bounding rectangle. See {@link Interactable.getRect}\n * @return {function | object} The checker function or this Interactable\n */","meta":{"range":[3730,3961],"filename":"Interactable.js","lineno":111,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100001533","name":"Interactable#rectChecker","type":"MethodDefinition","paramnames":["checker"]},"vars":{"":null},"shortpath":"src/Interactable.js"},"description":"<p>Returns or sets the function used to calculate the interactable's\nelement's rectangle</p>","params":[{"type":{"names":["function"]},"optional":true,"description":"<p>A function which returns this Interactable's\nbounding rectangle. See {@link Interactable.getRect}</p>","name":"checker"}],"returns":[{"type":{"names":["function","object"]},"description":"<p>The checker function or this Interactable</p>"}],"name":"rectChecker","longname":"Interactable#rectChecker","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R000167","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"rectChecker","signature":"<span class=\"signature\">(checker<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {function|object}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * ```js\n * interact(element).resizable({\n * onstart: function (event) {},\n * onmove : function (event) {},\n * onend : function (event) {},\n *\n * edges: {\n * top : true, // Use pointer coords to check for resize.\n * left : false, // Disable resizing from left edge.\n * bottom: '.resize-s',// Resize if pointer target matches selector\n * right : handleEl // Resize if pointer target is the given Element\n * },\n *\n * // Width and height can be adjusted independently. When `true`, width and\n * // height are adjusted at a 1:1 ratio.\n * square: false,\n *\n * // Width and height can be adjusted independently. When `true`, width and\n * // height maintain the aspect ratio they had when resizing started.\n * preserveAspectRatio: false,\n *\n * // a value of 'none' will limit the resize rect to a minimum of 0x0\n * // 'negate' will allow the rect to have negative width/height\n * // 'reposition' will keep the width/height positive by swapping\n * // the top and bottom edges and/or swapping the left and right edges\n * invert: 'none' || 'negate' || 'reposition'\n *\n * // limit multiple resizes.\n * // See the explanation in the {@link Interactable.draggable} example\n * max: Infinity,\n * maxPerElement: 1,\n * });\n *\n * var isResizeable = interact(element).resizable();\n * ```\n *\n * Gets or sets whether resize actions can be performed on the target\n *\n * @param {boolean | object} [options] true/false or An object with event\n * listeners to be fired on resize events (object makes the Interactable\n * resizable)\n * @return {boolean | Interactable} A boolean indicating if this can be the\n * target of resize elements, or this Interactable\n */","meta":{"range":[10565,11507],"filename":"resize.js","lineno":317,"columnno":0,"path":"/home/taye/proj/interact.js/src/actions","code":{"id":"astnode100008746","name":"Interactable.prototype.resizable","type":"FunctionExpression","paramnames":["options"]},"vars":{"this.options.resize.enabled":"Interactable#resizable#options.resize.enabled","this.options.resize.axis":"Interactable#resizable#options.resize.axis","this.options.resize.preserveAspectRatio":"Interactable#resizable#options.resize.preserveAspectRatio","this.options.resize.square":"Interactable#resizable#options.resize.square","this.onresizestart":"Interactable#resizable#onresizestart","this.onresizeend":"Interactable#resizable#onresizeend"},"shortpath":"src/actions/resize.js"},"description":"<pre class=\"prettyprint source lang-js\"><code>interact(element).resizable({\n onstart: function (event) {},\n onmove : function (event) {},\n onend : function (event) {},\n\n edges: {\n top : true, // Use pointer coords to check for resize.\n left : false, // Disable resizing from left edge.\n bottom: '.resize-s',// Resize if pointer target matches selector\n right : handleEl // Resize if pointer target is the given Element\n },\n\n // Width and height can be adjusted independently. When `true`, width and\n // height are adjusted at a 1:1 ratio.\n square: false,\n\n // Width and height can be adjusted independently. When `true`, width and\n // height maintain the aspect ratio they had when resizing started.\n preserveAspectRatio: false,\n\n // a value of 'none' will limit the resize rect to a minimum of 0x0\n // 'negate' will allow the rect to have negative width/height\n // 'reposition' will keep the width/height positive by swapping\n // the top and bottom edges and/or swapping the left and right edges\n invert: 'none' || 'negate' || 'reposition'\n\n // limit multiple resizes.\n // See the explanation in the {@link Interactable.draggable} example\n max: Infinity,\n maxPerElement: 1,\n});\n\nvar isResizeable = interact(element).resizable();\n</code></pre>\n<p>Gets or sets whether resize actions can be performed on the target</p>","params":[{"type":{"names":["boolean","object"]},"optional":true,"description":"<p>true/false or An object with event\nlisteners to be fired on resize events (object makes the Interactable\nresizable)</p>","name":"options"}],"returns":[{"type":{"names":["boolean","Interactable"]},"description":"<p>A boolean indicating if this can be the\ntarget of resize elements, or this Interactable</p>"}],"name":"resizable","longname":"Interactable#resizable","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R000911","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"resizable","signature":"<span class=\"signature\">(options<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {boolean|<a href=\"Interactable.html\">Interactable</a>}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * Reset the options of this Interactable\n *\n * @param {object} options The new settings to apply\n * @return {object} This Interactable\n */","meta":{"range":[8619,9357],"filename":"Interactable.js","lineno":294,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100001954","name":"Interactable#set","type":"MethodDefinition","paramnames":["options"]},"vars":{"":null},"shortpath":"src/Interactable.js"},"description":"<p>Reset the options of this Interactable</p>","params":[{"type":{"names":["object"]},"description":"<p>The new settings to apply</p>","name":"options"}],"returns":[{"type":{"names":["object"]},"description":"<p>This Interactable</p>"}],"name":"set","longname":"Interactable#set","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R000187","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"set","signature":"<span class=\"signature\">(options)</span><span class=\"type-signature\"> &rarr; {object}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * Returns or sets whether the the cursor should be changed depending on the\n * action that would be performed if the mouse were pressed and dragged.\n *\n * @param {boolean} [newValue]\n * @return {boolean | Interactable} The current setting or this Interactable\n */","meta":{"range":[5167,5440],"filename":"InteractableMethods.js","lineno":166,"columnno":0,"path":"/home/taye/proj/interact.js/src/autoStart","code":{"id":"astnode100010252","name":"Interactable.prototype.styleCursor","type":"FunctionExpression","paramnames":["newValue"]},"vars":{"this.options.styleCursor":"Interactable#styleCursor#options.styleCursor"},"shortpath":"src/autoStart/InteractableMethods.js"},"description":"<p>Returns or sets whether the the cursor should be changed depending on the\naction that would be performed if the mouse were pressed and dragged.</p>","params":[{"type":{"names":["boolean"]},"optional":true,"name":"newValue"}],"returns":[{"type":{"names":["boolean","Interactable"]},"description":"<p>The current setting or this Interactable</p>"}],"name":"styleCursor","longname":"Interactable#styleCursor","kind":"function","memberof":"Interactable","scope":"instance","___id":"T000002R001020","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"styleCursor","signature":"<span class=\"signature\">(newValue<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {boolean|<a href=\"Interactable.html\">Interactable</a>}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/**\n * Remove this interactable from the list of interactables and remove it's\n * action capabilities and event listeners\n *\n * @return {interact}\n */","meta":{"range":[9524,10769],"filename":"Interactable.js","lineno":335,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100002078","name":"Interactable#unset","type":"MethodDefinition","paramnames":[]},"vars":{"":null},"shortpath":"src/Interactable.js"},"description":"<p>Remove this interactable from the list of interactables and remove it's\naction capabilities and event listeners</p>","returns":[{"type":{"names":["interact"]}}],"name":"unset","longname":"Interactable#unset","kind":"function","memberof":"Interactable","scope":"instance","params":[],"___id":"T000002R000198","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"unset","signature":"<span class=\"signature\">()</span><span class=\"type-signature\"> &rarr; {<a href=\"global.html#interact\">interact</a>}</span>","ancestors":["<a href=\"Interactable.html\">Interactable</a>#"]},{"comment":"/** */","meta":{"range":[236,3017],"filename":"InteractEvent.js","lineno":8,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100000236","name":"InteractEvent","type":"MethodDefinition","paramnames":["interaction","event","action","phase","element","related","preEnd"]},"vars":{"":null},"shortpath":"src/InteractEvent.js"},"name":"InteractEvent","longname":"InteractEvent","kind":"class","scope":"global","params":[],"___id":"T000003R000003","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"InteractEvent","signature":"<span class=\"signature\">()</span><span class=\"type-signature\"></span>","ancestors":[]},{"comment":"/** */","meta":{"range":[3966,4070],"filename":"InteractEvent.js","lineno":136,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100000911","name":"InteractEvent#stopImmediatePropagation","type":"MethodDefinition","paramnames":[]},"vars":{"":null},"shortpath":"src/InteractEvent.js"},"name":"stopImmediatePropagation","longname":"InteractEvent#stopImmediatePropagation","kind":"function","memberof":"InteractEvent","scope":"instance","params":[],"___id":"T000002R000107","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"stopImmediatePropagation","signature":"<span class=\"signature\">()</span><span class=\"type-signature\"></span>","ancestors":["<a href=\"InteractEvent.html\">InteractEvent</a>#"]},{"comment":"/** */","meta":{"range":[4083,4143],"filename":"InteractEvent.js","lineno":141,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100000925","name":"InteractEvent#stopPropagation","type":"MethodDefinition","paramnames":[]},"vars":{"":null},"shortpath":"src/InteractEvent.js"},"name":"stopPropagation","longname":"InteractEvent#stopPropagation","kind":"function","memberof":"InteractEvent","scope":"instance","params":[],"___id":"T000002R000110","___s":true,"attribs":"<span class=\"type-signature\"></span>","id":"stopPropagation","signature":"<span class=\"signature\">()</span><span class=\"type-signature\"></span>","ancestors":["<a href=\"InteractEvent.html\">InteractEvent</a>#"]},{"comment":"/** */","meta":{"range":[629,2309],"filename":"Interaction.js","lineno":23,"columnno":2,"path":"/home/taye/proj/interact.js/src","code":{"id":"astnode100002546","name":"Interaction","type":"MethodDefinition","paramnames":[""]},"vars":{"":null},"shortpath":"src/Interaction.js"},"name":"Interaction","longname":"Interaction","kind":"class","scope":"global","params":[],"___id":"T000003R000004","___s":true,"attribs":"<span class=\"type-signature\">