kis-js/docs/$_.event.html

1090 lines
14 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: event</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Namespace: event</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="$_.html">$_</a>.</span>
event
</h2>
</header>
<article>
<div class="container-overview">
<div class="description">Event Listener module</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="event.js.html">modules/event.js</a>, <a href="event.js.html#line67">line 67</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="add"><span class="type-signature">&lt;static> </span>add<span class="signature">(event, callback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Adds an event that returns a callback when triggered on the selected
event and selector
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>event</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="event.js.html">modules/event.js</a>, <a href="event.js.html#line104">line 104</a>
</li></ul></dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>Eg. $_("#selector").event.add("click", do_something());</code></pre>
</dd>
<dt>
<h4 class="name" id="create"><span class="type-signature">&lt;static> </span>create<span class="signature">(name, <span class="optional">data</span>)</span><span class="type-signature"> &rarr; {Object}</span></h4>
</dt>
<dd>
<div class="description">
Create a custom event
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="event.js.html">modules/event.js</a>, <a href="event.js.html#line75">line 75</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>Eg. var event = $_("#selector").event.create('foo', {});</code></pre>
</dd>
<dt>
<h4 class="name" id="delegate"><span class="type-signature">&lt;static> </span>delegate<span class="signature">(target, event, callback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Binds an event to a parent object
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>target</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>event</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="event.js.html">modules/event.js</a>, <a href="event.js.html#line152">line 152</a>
</li></ul></dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>Eg. $_("#parent").delegate(".button", "click", do_something());</code></pre>
</dd>
<dt>
<h4 class="name" id="live"><span class="type-signature">&lt;static> </span>live<span class="signature">(target, event, callback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Binds a persistent event to the document
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>target</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>event</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="event.js.html">modules/event.js</a>, <a href="event.js.html#line137">line 137</a>
</li></ul></dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>Eg. $_.event.live(".button", "click", do_something());</code></pre>
</dd>
<dt>
<h4 class="name" id="remove"><span class="type-signature">&lt;static> </span>remove<span class="signature">(event, callback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Removes an event bound the the specified selector, event type, and callback
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>event</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="event.js.html">modules/event.js</a>, <a href="event.js.html#line121">line 121</a>
</li></ul></dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>Eg. $_("#selector").event.remove("click", do_something());</code></pre>
</dd>
<dt>
<h4 class="name" id="trigger"><span class="type-signature">&lt;static> </span>trigger<span class="signature">(event)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
</dt>
<dd>
<div class="description">
Trigger an event to fire
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>event</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="event.js.html">modules/event.js</a>, <a href="event.js.html#line169">line 169</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>Eg. $_("#my_id").trigger('click');</code></pre>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="$_.html">$_</a></li><li><a href="$_.dom.html">dom</a></li><li><a href="$_.event.html">event</a></li><li><a href="$_.store.html">store</a></li></ul><h3>Global</h3><ul><li><a href="global.html#data[undefined]">data[undefined]</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Fri Sep 05 2014 11:56:00 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>