1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <meta http-equiv="content-type" content="text/html; charset=undefined" />
8 <meta name="generator" content="JsDoc Toolkit" />
11 <title>JsDoc Reference - Roo.EventManager</title>
14 <link rel="stylesheet" type="text/css" href="../../css/roojs.css" />
15 <link rel="stylesheet" type="text/css" href="../default.css" />
18 <script type="text/javascript" src="../page.js">
25 <body onload="RooDocsPage.onload();">
28 <div class="body-wrap">
30 <!-- ============================== links to methods. ================================= -->
32 <div class="top-tools">
34 <a class="inner-link" href="#Roo.EventManager-props"><img src="resources/s.gif" class="item-icon icon-prop">Properties</a>
35 <a class="inner-link" href="#Roo.EventManager-methods"><img src="resources/s.gif" class="item-icon icon-method">Methods</a>
36 <a class="inner-link" href="#Roo.EventManager-events"><img src="resources/s.gif" class="item-icon icon-event">Events</a>
37 <a class="inner-link" href="#Roo.EventManager-configs"><img src="resources/s.gif" class="item-icon icon-config">Config Options</a>
38 <a class="bookmark" href="NEED_TO_CREATE_DIRECT_LINK_HREF"><img src="resources/s.gif" class="item-icon icon-fav">Direct Link</a>
43 <!-- ============================== inheritance Block. ================================= -->
45 <!-- ============================== class title / details ============================ -->
48 <h1 class="classTitle">
50 Class Roo.EventManager
53 <table cellspacing="0" class="class-summary-table">
55 <tr><td class="label">Package:</td><td class="hd-info">Roo</td></tr>
57 <tr><td class="label">Defined In:</td><td class="hd-info">
59 <a href="./src/Roo_EventManager.js.html">Roo/EventManager.js</a>.
62 <tr><td class="label">Class:</td><td class="hd-info">EventManager</td></tr>
70 <!-- ============================== class summary ========================== -->
71 <div class="description">
72 Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides <br/>several useful events directly.<br/>See {<b>link</b> Roo.EventObject} for more details on normalized event objects.
76 <!-- ============================== Class comment block... ========================== -->
78 <div class="comments">
79 <b>Class Comments / Notes</B> =>
80 <u onclick="parent.CommentDialog.showCommentId = 'Roo.EventManager';">[Add Your comment/notes about this class]</u>
82 <iframe frameborder="0" id="comments-Roo" style="border: none;width:100%;"
83 src="/blog.php/GtkDjsComments/Roo.EventManager.html"></iframe>
88 <!-- ============================== config options ========================== -->
93 <div class="hr"></div>
94 <a id="Roo.EventManager-configs"></a>
98 <table cellspacing="0" class="member-table">
99 <caption class="Empty">Config Options - Has None</caption>
113 <!-- ============================== public properties ==================== -->
117 <a id="Roo.EventManager-props"></a>
125 <table cellspacing="0" class="member-table">
126 <caption>Public Properties </caption>
128 <th class="sig-header" colspan="2">Property</th>
129 <th class="sig-header">Description</th>
130 <th class="msource-header">Defined By</th>
140 <tr class="property-row config-row-alt0 notInherited">
142 <a class="exi" href="#expand"> </a>
145 <a id="Roo.EventManager-prop-ieDeferSrc" name=".ieDeferSrc"></a>
146 <div class="fixedFont">
147 <span class="attributes">Roo.EventManager.</span><b class="itemname">ieDeferSrc</b> :
148 <span type="etype"></span>
156 Url used for onDocumentReady with using SSL (defaults to Roo.SSL_SECURE_URL)
164 Url used for onDocumentReady with using SSL (defaults to Roo.SSL_SECURE_URL)
179 <tr class="property-row config-row-alt1 notInherited">
181 <a class="exi" href="#expand"> </a>
184 <a id="Roo.EventManager-prop-textResizeInterval" name=".textResizeInterval"></a>
185 <div class="fixedFont">
186 <span class="attributes">Roo.EventManager.</span><b class="itemname">textResizeInterval</b> :
187 <span type="etype"></span>
195 The frequency, in milliseconds, to check for text resize events (defaults to 50)
203 The frequency, in milliseconds, to check for text resize events (defaults to 50)
219 <!-- TODO: implement this alt row. also notice non-linked "Defined by" when property is a part of this class.
220 <tr class="property-row alt">
227 <!-- ============================== methods summary / details ======================== -->
230 <a id="Roo.EventManager-methods"></a>
231 <!-- constructor?? -->
238 <!-- then dynamics first -->
245 <table cellspacing="0" class="member-table">
246 <caption>Public Methods</caption>
248 <th class="sig-header" colspan="2">Method</th>
249 <th class="msource-header">Defined By</th>
259 <tr class="method-row config-row-alt0 expandable notInherited">
260 <td class="micon"><a class="exi" href="#expand"> </a></td>
264 <a id="Roo.EventManager-method-addListener" name=".addListener"></a>
265 <div class="fixedFont">
266 <span class="attributes">Roo.EventManager.</span><b class="itemname">addListener</b>
268 (<a href="./String.html#constructor" roo:cls="String.html#constructor">String</a>/HTMLElement <B><i>element</i></B>, <a href="./String.html#constructor" roo:cls="String.html#constructor">String</a> <B><i>eventName</i></B>, <a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a> <B><i>handler</i></B>, <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a> <B><i>scope</i></B>, <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a> <B><i>options</i></B>)
275 <div class="short">Appends an event handler to an element (shorthand for addListener)</div>
281 Appends an event handler to an element (shorthand for addListener)
288 <dl class="detailList">
289 <dt class="heading">Parameters:</dt>
292 <span class="fixedFont"><a href="./String.html#constructor" roo:cls="String.html#constructor">String</a>/HTMLElement</span> <b>element</b>
295 <dd>The html element or id to assign the</dd>
298 <span class="fixedFont"><a href="./String.html#constructor" roo:cls="String.html#constructor">String</a></span> <b>eventName</b>
301 <dd>The type of event to listen for</dd>
304 <span class="fixedFont"><a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a></span> <b>handler</b>
307 <dd>The method the event invokes</dd>
310 <span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a></span> <b>scope</b>
313 <dd>(optional) The scope in which to execute the handler<br/>function. The handler function's "this" context.</dd>
316 <span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a></span> <b>options</b>
319 <dd>(optional) An object containing handler configuration<br/>properties. This may contain any of the following properties:<ul><br/><li>scope {Object} The scope in which to execute the handler function. The handler function's "this" context.</li><br/><li>delegate {String} A simple selector to filter the target or look for a descendant of the target</li><br/><li>stopEvent {Boolean} True to stop the event. That is stop propagation, and prevent the default action.</li><br/><li>preventDefault {Boolean} True to prevent the default action</li><br/><li>stopPropagation {Boolean} True to prevent event propagation</li><br/><li>normalized {Boolean} False to pass a browser event to the handler function instead of an Roo.EventObject</li><br/><li>delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.</li><br/><li>single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.</li><br/><li>buffer {Number} Causes the handler to be scheduled to run in an {<b>link</b> Roo.util.DelayedTask} delayed<br/>by the specified number of milliseconds. If the event fires again within that time, the original<br/>handler is <em>not</em> invoked, but the new handler is scheduled in its place.</li><br/></ul><br><br/><p><br/><b>Combining Options</b><br><br/>Using the options argument, it is possible to combine different types of listeners:<br><br/><br><br/>A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)<div style="margin: 5px 20px 20px;"><br/>Code:<pre><code><br/>el.on('click', this.onClick, this, {<br/> single: true,<br/> delay: 100,<br/> stopEvent : true,<br/> forumId: 4<br/>});</code></pre><br/><p><br/><b>Attaching multiple handlers in 1 call</b><br><br/>The method also allows for a single argument to be passed which is a config object containing properties<br/>which specify multiple handlers.<br/><p><br/>Code:<pre><code><br/>el.on({<br/> 'click' : {<br/> fn: this.onClick<br/> scope: this,<br/> delay: 100<br/> },<br/> 'mouseover' : {<br/> fn: this.onMouseOver<br/> scope: this<br/> },<br/> 'mouseout' : {<br/> fn: this.onMouseOut<br/> scope: this<br/> }<br/>});</code></pre><br/><p><br/>Or a shorthand syntax:<br><br/>Code:<pre><code><br/>el.on({<br/> 'click' : this.onClick,<br/> 'mouseover' : this.onMouseOver,<br/> 'mouseout' : this.onMouseOut<br/> scope: this<br/>});</code></pre></dd>
345 <tr class="method-row config-row-alt1 expandable notInherited">
346 <td class="micon"><a class="exi" href="#expand"> </a></td>
350 <a id="Roo.EventManager-method-on" name=".on"></a>
351 <div class="fixedFont">
352 <span class="attributes">Roo.EventManager.</span><b class="itemname">on</b>
354 (<a href="./String.html#constructor" roo:cls="String.html#constructor">String</a>/HTMLElement <B><i>element</i></B>, <a href="./String.html#constructor" roo:cls="String.html#constructor">String</a> <B><i>eventName</i></B>, <a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a> <B><i>handler</i></B>, <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a> <B><i>scope</i></B>, <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a> <B><i>options</i></B>)
361 <div class="short">Appends an event handler to an element (shorthand for addListener)</div>
367 Appends an event handler to an element (shorthand for addListener)
374 <dl class="detailList">
375 <dt class="heading">Parameters:</dt>
378 <span class="fixedFont"><a href="./String.html#constructor" roo:cls="String.html#constructor">String</a>/HTMLElement</span> <b>element</b>
381 <dd>The html element or id to assign the</dd>
384 <span class="fixedFont"><a href="./String.html#constructor" roo:cls="String.html#constructor">String</a></span> <b>eventName</b>
387 <dd>The type of event to listen for</dd>
390 <span class="fixedFont"><a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a></span> <b>handler</b>
393 <dd>The method the event invokes</dd>
396 <span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a></span> <b>scope</b>
399 <dd>(optional) The scope in which to execute the handler<br/>function. The handler function's "this" context.</dd>
402 <span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a></span> <b>options</b>
405 <dd>(optional) An object containing handler configuration<br/>properties. This may contain any of the following properties:<ul><br/><li>scope {Object} The scope in which to execute the handler function. The handler function's "this" context.</li><br/><li>delegate {String} A simple selector to filter the target or look for a descendant of the target</li><br/><li>stopEvent {Boolean} True to stop the event. That is stop propagation, and prevent the default action.</li><br/><li>preventDefault {Boolean} True to prevent the default action</li><br/><li>stopPropagation {Boolean} True to prevent event propagation</li><br/><li>normalized {Boolean} False to pass a browser event to the handler function instead of an Roo.EventObject</li><br/><li>delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.</li><br/><li>single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.</li><br/><li>buffer {Number} Causes the handler to be scheduled to run in an {<b>link</b> Roo.util.DelayedTask} delayed<br/>by the specified number of milliseconds. If the event fires again within that time, the original<br/>handler is <em>not</em> invoked, but the new handler is scheduled in its place.</li><br/></ul><br><br/><p><br/><b>Combining Options</b><br><br/>Using the options argument, it is possible to combine different types of listeners:<br><br/><br><br/>A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)<div style="margin: 5px 20px 20px;"><br/>Code:<pre><code><br/>el.on('click', this.onClick, this, {<br/> single: true,<br/> delay: 100,<br/> stopEvent : true,<br/> forumId: 4<br/>});</code></pre><br/><p><br/><b>Attaching multiple handlers in 1 call</b><br><br/>The method also allows for a single argument to be passed which is a config object containing properties<br/>which specify multiple handlers.<br/><p><br/>Code:<pre><code><br/>el.on({<br/> 'click' : {<br/> fn: this.onClick<br/> scope: this,<br/> delay: 100<br/> },<br/> 'mouseover' : {<br/> fn: this.onMouseOver<br/> scope: this<br/> },<br/> 'mouseout' : {<br/> fn: this.onMouseOut<br/> scope: this<br/> }<br/>});</code></pre><br/><p><br/>Or a shorthand syntax:<br><br/>Code:<pre><code><br/>el.on({<br/> 'click' : this.onClick,<br/> 'mouseover' : this.onMouseOver,<br/> 'mouseout' : this.onMouseOut<br/> scope: this<br/>});</code></pre></dd>
431 <tr class="method-row config-row-alt0 expandable notInherited">
432 <td class="micon"><a class="exi" href="#expand"> </a></td>
436 <a id="Roo.EventManager-method-onDocumentReady" name=".onDocumentReady"></a>
437 <div class="fixedFont">
438 <span class="attributes">Roo.EventManager.</span><b class="itemname">onDocumentReady</b>
440 (<a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a> <B><i>fn</i></B>, <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a> <B><i>scope</i></B>, boolean <B><i>options</i></B>)
447 <div class="short">Fires when the document is ready (before onload and before images are loaded).</div>
453 Fires when the document is ready (before onload and before images are loaded). Can be <br/>accessed shorthanded Roo.onReady().
460 <dl class="detailList">
461 <dt class="heading">Parameters:</dt>
464 <span class="fixedFont"><a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a></span> <b>fn</b>
467 <dd>The method the event invokes</dd>
470 <span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a></span> <b>scope</b>
473 <dd>An object that becomes the scope of the handler</dd>
476 <span class="fixedFont">boolean</span> <b>options</b>
505 <tr class="method-row config-row-alt1 expandable notInherited">
506 <td class="micon"><a class="exi" href="#expand"> </a></td>
510 <a id="Roo.EventManager-method-onTextResize" name=".onTextResize"></a>
511 <div class="fixedFont">
512 <span class="attributes">Roo.EventManager.</span><b class="itemname">onTextResize</b>
514 (<a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a> <B><i>fn</i></B>, <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a> <B><i>scope</i></B>, boolean <B><i>options</i></B>)
521 <div class="short">Fires when the user changes the active text size.</div>
527 Fires when the user changes the active text size. Handler gets called with 2 params, the old size and the new size.
534 <dl class="detailList">
535 <dt class="heading">Parameters:</dt>
538 <span class="fixedFont"><a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a></span> <b>fn</b>
541 <dd>The method the event invokes</dd>
544 <span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a></span> <b>scope</b>
547 <dd>An object that becomes the scope of the handler</dd>
550 <span class="fixedFont">boolean</span> <b>options</b>
579 <tr class="method-row config-row-alt0 expandable notInherited">
580 <td class="micon"><a class="exi" href="#expand"> </a></td>
584 <a id="Roo.EventManager-method-onWindowResize" name=".onWindowResize"></a>
585 <div class="fixedFont">
586 <span class="attributes">Roo.EventManager.</span><b class="itemname">onWindowResize</b>
588 (<a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a> <B><i>fn</i></B>, <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a> <B><i>scope</i></B>, boolean <B><i>options</i></B>)
595 <div class="short">Fires when the window is resized and provides resize event buffering (50 milliseconds), passes new viewport width and height to handlers.</div>
601 Fires when the window is resized and provides resize event buffering (50 milliseconds), passes new viewport width and height to handlers.
608 <dl class="detailList">
609 <dt class="heading">Parameters:</dt>
612 <span class="fixedFont"><a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a></span> <b>fn</b>
615 <dd>The method the event invokes</dd>
618 <span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a></span> <b>scope</b>
621 <dd>An object that becomes the scope of the handler</dd>
624 <span class="fixedFont">boolean</span> <b>options</b>
653 <tr class="method-row config-row-alt1 expandable notInherited">
654 <td class="micon"><a class="exi" href="#expand"> </a></td>
658 <a id="Roo.EventManager-method-removeListener" name=".removeListener"></a>
659 <div class="fixedFont">
660 <span class="attributes">Roo.EventManager.</span><b class="itemname">removeListener</b>
662 (<a href="./String.html#constructor" roo:cls="String.html#constructor">String</a>/HTMLElement <B><i>element</i></B>, <a href="./String.html#constructor" roo:cls="String.html#constructor">String</a> <B><i>eventName</i></B>, <a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a> <B><i>fn</i></B>)
668 <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Boolean">Boolean</a>
677 <div class="short">Removes an event handler</div>
683 Removes an event handler
690 <dl class="detailList">
691 <dt class="heading">Parameters:</dt>
694 <span class="fixedFont"><a href="./String.html#constructor" roo:cls="String.html#constructor">String</a>/HTMLElement</span> <b>element</b>
697 <dd>The id or html element to remove the <br/> event from</dd>
700 <span class="fixedFont"><a href="./String.html#constructor" roo:cls="String.html#constructor">String</a></span> <b>eventName</b>
703 <dd>The type of event</dd>
706 <span class="fixedFont"><a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a></span> <b>fn</b>
717 <dl class="detailList">
718 <dt class="heading">Returns:</dt>
720 <dd><span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Boolean">Boolean</a></span> True if a listener was actually removed</dd>
742 <tr class="method-row config-row-alt0 expandable notInherited">
743 <td class="micon"><a class="exi" href="#expand"> </a></td>
747 <a id="Roo.EventManager-method-removeResizeListener" name=".removeResizeListener"></a>
748 <div class="fixedFont">
749 <span class="attributes">Roo.EventManager.</span><b class="itemname">removeResizeListener</b>
751 (<a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a> <B><i>fn</i></B>, <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a> <B><i>scope</i></B>)
758 <div class="short">Removes the passed window resize listener.</div>
764 Removes the passed window resize listener.
771 <dl class="detailList">
772 <dt class="heading">Parameters:</dt>
775 <span class="fixedFont"><a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a></span> <b>fn</b>
778 <dd>The method the event invokes</dd>
781 <span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a></span> <b>scope</b>
784 <dd>The scope of handler</dd>
810 <tr class="method-row config-row-alt1 expandable notInherited">
811 <td class="micon"><a class="exi" href="#expand"> </a></td>
815 <a id="Roo.EventManager-method-wrap" name=".wrap"></a>
816 <div class="fixedFont">
817 <span class="attributes">Roo.EventManager.</span><b class="itemname">wrap</b>
819 (<a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a> <B><i>fn</i></B>, <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a> <B><i>scope</i></B>, boolean <B><i>override</i></B>)
825 <a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a>
834 <div class="short">This is no longer needed and is deprecated.</div>
840 This is no longer needed and is deprecated. Places a simple wrapper around an event handler to override the browser event<br/>object with a Roo.EventObject
847 <dl class="detailList">
848 <dt class="heading">Parameters:</dt>
851 <span class="fixedFont"><a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a></span> <b>fn</b>
854 <dd>The method the event invokes</dd>
857 <span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a></span> <b>scope</b>
860 <dd>An object that becomes the scope of the handler</dd>
863 <span class="fixedFont">boolean</span> <b>override</b>
866 <dd>If true, the obj passed in becomes<br/> the execution scope of the listener</dd>
874 <dl class="detailList">
875 <dt class="heading">Returns:</dt>
877 <dd><span class="fixedFont"><a href="./Function.html#constructor" roo:cls="Function.html#constructor">Function</a></span> The wrapped function</dd>
902 <!-- ============================== events summary / details ======================== -->
905 <a id="Roo.EventManager-events"></a>
911 <table cellspacing="0" class="member-table">
912 <caption class="Empty">Events - Has None</caption>
923 <!-- ============================== footer ================================= -->
924 <div class="fineprint" style="clear:both">
926 Documentation generated by <a href="http://www.akbkhome.com" target="_blankt">Introspection Doc Generator</a> on Mon Feb 22 2016 16:54:34 GMT+0800 (HKT)
928 <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a>