-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-11.html
9 lines (8 loc) · 6.48 KB
/
template-11.html
1
2
3
4
5
6
7
8
9
<link rel="stylesheet" href="./resources/styles/elf-template.css">
<h1 id="eventdispatcher">EventDispatcher</h1>
<div id="elf-api-container"><div id="main-template" class="elf-template"> <section><header> <h1 class="subsection-title"><span class="attribs"><span class="type-signature"></span></span>EventDispatcher<span class="signature">()</span><span class="type-signature"></span></h1> </header><article> <div class="container-overview">
<div class="item"> <div class="item-type">class</div> <h4 class="name" id="EventDispatcher"><span class="type-signature"></span>new EventDispatcher<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> Abstract base class that provides event management methods for derived class </div> <div class="details"> </div> </div> </div> <h3 class="subsection-title" id="methods">Methods</h3>
<div class="item"> <div class="item-type">function</div> <h4 class="name" id="listen"><span class="type-signature"></span>listen<span class="signature">(type, handler, opt_priority<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <h5>Parameters:</h5> <div class="params"> <div class="param"> <div class="name">type</div> <div class="type"> <span class="param-type">string</span> </div> <div class="attributes"> </div> <div class="description"> Any event provided by derived class </div> </div> <div class="param"> <div class="name">handler</div> <div class="type"> <span class="param-type">function</span> </div> <div class="attributes"> </div> <div class="description"> Callback method </div> </div> <div class="param"> <div class="name">opt_priority</div> <div class="type"> <span class="param-type">number</span> </div> <div class="attributes"> <optional> </div> <div class="description"> The higher the priority, the sooner the listener get executed. Undefined priority listener will be executed last </div> </div> </div> <div class="details"> </div> <h5>Example:</h5> <pre><code>var grid = new Grid();
grid.listen("click", function(e) { console.log("Grid is clicked"); });</code></pre> </div>
<div class="item"> <div class="item-type">function</div> <h4 class="name" id="unlisten"><span class="type-signature"></span>unlisten<span class="signature">(type, handler)</span><span class="type-signature"></span></h4> <div class="description"> Removes an event listener which was added with listen(). The same function handler must be sent in, or else it will not be removed </div> <h5>Parameters:</h5> <div class="params"> <div class="param"> <div class="name">type</div> <div class="type"> <span class="param-type">string</span> </div> <div class="description"> The name of the event without the 'on' prefix. </div> </div> <div class="param"> <div class="name">handler</div> <div class="type"> <span class="param-type">function</span> </div> <div class="description"> The listener function to remove. </div> </div> </div> <div class="details"> </div> </div>
<div class="item"> <div class="item-type">function</div> <h4 class="name" id="unlistenAll"><span class="type-signature"></span>unlistenAll<span class="signature">(type<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> Removes all listeners from an object. If no type is specified, it will remove all listeners that have been registered. <br>You can also optionally remove listeners of a particular type. </div> <h5>Parameters:</h5> <div class="params"> <div class="param"> <div class="name">type</div> <div class="type"> <span class="param-type">string</span> </div> <div class="attributes"> <optional> </div> <div class="description"> Type of event to, default is all types. </div> </div> </div> <div class="details"> </div> </div> </article></section></div></div>