|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
|
2 <html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#"> |
|
3 <head> |
|
4 <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> |
|
5 <title>API: event-custom EventTarget (YUI Library)</title> |
|
6 |
|
7 <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" /> |
|
8 <link rel="stylesheet" type="text/css" href="assets/api.css" /> |
|
9 |
|
10 <script type="text/javascript" src="assets/api-js"></script> |
|
11 <script type="text/javascript" src="assets/ac-js"></script> |
|
12 </head> |
|
13 |
|
14 <body id="yahoo-com"> |
|
15 |
|
16 <div id="doc3" class="yui-t2"> |
|
17 <div id="hd"> |
|
18 <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1> |
|
19 <h3>event-custom <span class="subtitle">3.0.0</span></h3> |
|
20 <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> |
|
21 > <a href="./module_event-custom.html" title="event-custom">event-custom</a> |
|
22 > EventTarget |
|
23 |
|
24 <form onsubmit="return false"> |
|
25 <div id="propertysearch"> |
|
26 Search: <input autocomplete="off" id="searchinput" /> |
|
27 <div id="searchresults"> |
|
28 |
|
29 </div> |
|
30 </div> |
|
31 </form> |
|
32 </div> |
|
33 |
|
34 <div id="bd"> |
|
35 <div id="yui-main"> |
|
36 <div class="yui-b"> |
|
37 <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form"> |
|
38 <fieldset> |
|
39 <legend>Filters</legend> |
|
40 <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span> |
|
41 <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span> |
|
42 <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span> |
|
43 </fieldset> |
|
44 </form> |
|
45 |
|
46 <h2> |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 Class <b property="yui:name">EventTarget</b> |
|
52 <span class="extends"> |
|
53 </span> |
|
54 |
|
55 </h2> |
|
56 <!-- class tree goes here --> |
|
57 |
|
58 <dl class="subclasses" rel="yui:subclasses"> |
|
59 <dt>Known Subclasses:</dt> |
|
60 <dd> |
|
61 <span rel="yui:subclass" resource="AsyncQueue.html"> |
|
62 <a href="AsyncQueue.html" property="yui:name" title="AsyncQueue">AsyncQueue</a> |
|
63 </span> |
|
64 </dd> |
|
65 </dl> |
|
66 |
|
67 |
|
68 |
|
69 <div class="summary description" property="yui:description"> |
|
70 EventTarget provides the implementation for any object to |
|
71 publish, subscribe and fire to custom events, and also |
|
72 alows other EventTargets to target the object with events |
|
73 sourced from the other object. |
|
74 EventTarget is designed to be used with Y.augment to wrap |
|
75 EventCustom in an interface that allows events to be listened to |
|
76 and fired by name. This makes it possible for implementing code to |
|
77 subscribe to an event that either has not been created yet, or will |
|
78 not be created at all. |
|
79 </div> |
|
80 |
|
81 |
|
82 <div rel="yui:properties" resource="#properties"> |
|
83 |
|
84 </div> |
|
85 |
|
86 <div rel="yui:methods" resource="#methods"> |
|
87 <div class="section method details"> |
|
88 <h3 id="methods">Methods</h3> |
|
89 <div class="content"> |
|
90 <div class="private" rel="yui:method" resource="#method__getType"> |
|
91 <h4> |
|
92 <a name="method__getType">_getType</a></h4> |
|
93 <div class="detail" > |
|
94 <code> |
|
95 private |
|
96 |
|
97 |
|
98 void |
|
99 <strong property="yui:name">_getType</strong> |
|
100 ( |
|
101 ) |
|
102 </code> |
|
103 |
|
104 <div class="description" property="yui:description"> |
|
105 If the instance has a prefix attribute and the |
|
106 event type is not prefixed, the instance prefix is |
|
107 applied to the supplied type. |
|
108 </div> |
|
109 |
|
110 <div class="description"> |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 </div> |
|
118 |
|
119 </div> |
|
120 <hr /> |
|
121 </div> |
|
122 <div class="private" rel="yui:method" resource="#method__parseType"> |
|
123 <h4> |
|
124 <a name="method__parseType">_parseType</a></h4> |
|
125 <div class="detail" > |
|
126 <code> |
|
127 private |
|
128 |
|
129 |
|
130 void |
|
131 <strong property="yui:name">_parseType</strong> |
|
132 ( |
|
133 ) |
|
134 </code> |
|
135 |
|
136 <div class="description" property="yui:description"> |
|
137 Returns an array with the detach key (if provided), |
|
138 and the prefixed event name from _getType |
|
139 Y.on('detachcategory, menu:click', fn) |
|
140 </div> |
|
141 |
|
142 <div class="description"> |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 </div> |
|
150 |
|
151 </div> |
|
152 <hr /> |
|
153 </div> |
|
154 <div class="" rel="yui:method" resource="#method_addTarget"> |
|
155 <h4> |
|
156 <a name="method_addTarget">addTarget</a></h4> |
|
157 <div class="detail" > |
|
158 <code> |
|
159 |
|
160 |
|
161 |
|
162 void |
|
163 <strong property="yui:name">addTarget</strong> |
|
164 ( |
|
165 |
|
166 |
|
167 o |
|
168 |
|
169 |
|
170 ) |
|
171 </code> |
|
172 |
|
173 <div class="description" property="yui:description"> |
|
174 Registers another EventTarget as a bubble target. Bubble order |
|
175 is determined by the order registered. Multiple targets can |
|
176 be specified. |
|
177 </div> |
|
178 |
|
179 <div class="description"> |
|
180 |
|
181 <dl rel="yui:parameters"> |
|
182 <dt>Parameters:</dt> |
|
183 <dd rel="yui:parameter"> |
|
184 <code><span property="yui:name">o</span> |
|
185 <<span property="yui:type">EventTarget</span>> |
|
186 </code> |
|
187 <span property="yui:description"> the target to add</span> |
|
188 </dd> |
|
189 </dl> |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 </div> |
|
196 |
|
197 </div> |
|
198 <hr /> |
|
199 </div> |
|
200 <div class="" rel="yui:method" resource="#method_after"> |
|
201 <h4> |
|
202 <a name="method_after">after</a></h4> |
|
203 <div class="detail" > |
|
204 <code> |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 <strong property="yui:name">after</strong> |
|
210 ( |
|
211 |
|
212 |
|
213 type |
|
214 |
|
215 |
|
216 , |
|
217 fn |
|
218 |
|
219 |
|
220 ) |
|
221 </code> |
|
222 |
|
223 <div class="description" property="yui:description"> |
|
224 Subscribe to a custom event hosted by this object. The |
|
225 supplied callback will execute after any listeners add |
|
226 via the subscribe method, and after the default function, |
|
227 if configured for the event, has executed. |
|
228 </div> |
|
229 |
|
230 <div class="description"> |
|
231 |
|
232 <dl rel="yui:parameters"> |
|
233 <dt>Parameters:</dt> |
|
234 <dd rel="yui:parameter"> |
|
235 <code><span property="yui:name">type</span> |
|
236 <<span property="yui:type">string</span>> |
|
237 </code> |
|
238 <span property="yui:description"> The type of the event</span> |
|
239 </dd> |
|
240 <dd rel="yui:parameter"> |
|
241 <code><span property="yui:name">fn</span> |
|
242 <<span property="yui:type">Function</span>> |
|
243 </code> |
|
244 <span property="yui:description"> The callback</span> |
|
245 </dd> |
|
246 </dl> |
|
247 |
|
248 <dl> |
|
249 <dt>Returns: |
|
250 <code property="yui:return"> |
|
251 </code></dt> |
|
252 <dd property="yui:returnInfo">the event target or a detach handle per 'chain' config</dd> |
|
253 </dl> |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 </div> |
|
259 |
|
260 </div> |
|
261 <hr /> |
|
262 </div> |
|
263 <div class=" deprecated" rel="yui:method" resource="#method_before"> |
|
264 <h4> |
|
265 <a name="method_before">before</a></h4> |
|
266 <div class="detail" > |
|
267 <code> |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 <strong property="yui:name">before</strong> |
|
273 ( |
|
274 ) |
|
275 </code> |
|
276 |
|
277 <div class="description" property="yui:description"> |
|
278 Executes the callback before a DOM event, custom event |
|
279 or method. If the first argument is a function, it |
|
280 is assumed the target is a method. For DOM and custom |
|
281 events, this is an alias for Y.on. |
|
282 For DOM and custom events: |
|
283 type, callback, context, 0-n arguments |
|
284 For methods: |
|
285 callback, object (method host), methodName, context, 0-n arguments |
|
286 </div> |
|
287 |
|
288 <div class="description"> |
|
289 |
|
290 |
|
291 <dl> |
|
292 <dt>Returns: |
|
293 <code property="yui:return"> |
|
294 </code></dt> |
|
295 <dd property="yui:returnInfo">detach handle</dd> |
|
296 </dl> |
|
297 |
|
298 |
|
299 |
|
300 <div class="deprecated"> |
|
301 <strong>Deprecated</strong> use the on method |
|
302 </div> |
|
303 |
|
304 </div> |
|
305 |
|
306 </div> |
|
307 <hr /> |
|
308 </div> |
|
309 <div class="" rel="yui:method" resource="#method_bubble"> |
|
310 <h4> |
|
311 <a name="method_bubble">bubble</a></h4> |
|
312 <div class="detail" > |
|
313 <code> |
|
314 |
|
315 |
|
316 |
|
317 boolean |
|
318 <strong property="yui:name">bubble</strong> |
|
319 ( |
|
320 |
|
321 |
|
322 evt |
|
323 |
|
324 |
|
325 ) |
|
326 </code> |
|
327 |
|
328 <div class="description" property="yui:description"> |
|
329 Propagate an event. Requires the event-custom-complex module. |
|
330 </div> |
|
331 |
|
332 <div class="description"> |
|
333 |
|
334 <dl rel="yui:parameters"> |
|
335 <dt>Parameters:</dt> |
|
336 <dd rel="yui:parameter"> |
|
337 <code><span property="yui:name">evt</span> |
|
338 <<span property="yui:type">Event.Custom</span>> |
|
339 </code> |
|
340 <span property="yui:description"> the custom event to propagate</span> |
|
341 </dd> |
|
342 </dl> |
|
343 |
|
344 <dl> |
|
345 <dt>Returns: |
|
346 <code property="yui:return"> |
|
347 boolean |
|
348 </code></dt> |
|
349 <dd property="yui:returnInfo">the aggregated return value from Event.Custom.fire</dd> |
|
350 </dl> |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 </div> |
|
356 |
|
357 </div> |
|
358 <hr /> |
|
359 </div> |
|
360 <div class="" rel="yui:method" resource="#method_detach"> |
|
361 <h4> |
|
362 <a name="method_detach">detach</a></h4> |
|
363 <div class="detail" > |
|
364 <code> |
|
365 |
|
366 |
|
367 |
|
368 EventTarget |
|
369 <strong property="yui:name">detach</strong> |
|
370 ( |
|
371 |
|
372 |
|
373 type |
|
374 |
|
375 |
|
376 , |
|
377 fn |
|
378 |
|
379 |
|
380 , |
|
381 context |
|
382 |
|
383 |
|
384 ) |
|
385 </code> |
|
386 |
|
387 <div class="description" property="yui:description"> |
|
388 Detach one or more listeners the from the specified event |
|
389 </div> |
|
390 |
|
391 <div class="description"> |
|
392 |
|
393 <dl rel="yui:parameters"> |
|
394 <dt>Parameters:</dt> |
|
395 <dd rel="yui:parameter"> |
|
396 <code><span property="yui:name">type</span> |
|
397 <<span property="yui:type">string|Object</span>> |
|
398 </code> |
|
399 <span property="yui:description"> Either the handle to the subscriber or the |
|
400 type of event. If the type |
|
401 is not specified, it will attempt to remove |
|
402 the listener from all hosted events.</span> |
|
403 </dd> |
|
404 <dd rel="yui:parameter"> |
|
405 <code><span property="yui:name">fn</span> |
|
406 <<span property="yui:type">Function</span>> |
|
407 </code> |
|
408 <span property="yui:description"> The subscribed function to unsubscribe, if not |
|
409 supplied, all subscribers will be removed.</span> |
|
410 </dd> |
|
411 <dd rel="yui:parameter"> |
|
412 <code><span property="yui:name">context</span> |
|
413 <<span property="yui:type">Object</span>> |
|
414 </code> |
|
415 <span property="yui:description"> The custom object passed to subscribe. This is |
|
416 optional, but if supplied will be used to |
|
417 disambiguate multiple listeners that are the same |
|
418 (e.g., you subscribe many object using a function |
|
419 that lives on the prototype)</span> |
|
420 </dd> |
|
421 </dl> |
|
422 |
|
423 <dl> |
|
424 <dt>Returns: |
|
425 <code property="yui:return"> |
|
426 EventTarget |
|
427 </code></dt> |
|
428 <dd property="yui:returnInfo">the host</dd> |
|
429 </dl> |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 </div> |
|
435 |
|
436 </div> |
|
437 <hr /> |
|
438 </div> |
|
439 <div class="" rel="yui:method" resource="#method_detachAll"> |
|
440 <h4> |
|
441 <a name="method_detachAll">detachAll</a></h4> |
|
442 <div class="detail" > |
|
443 <code> |
|
444 |
|
445 |
|
446 |
|
447 void |
|
448 <strong property="yui:name">detachAll</strong> |
|
449 ( |
|
450 |
|
451 |
|
452 type |
|
453 |
|
454 |
|
455 ) |
|
456 </code> |
|
457 |
|
458 <div class="description" property="yui:description"> |
|
459 Removes all listeners from the specified event. If the event type |
|
460 is not specified, all listeners from all hosted custom events will |
|
461 be removed. |
|
462 </div> |
|
463 |
|
464 <div class="description"> |
|
465 |
|
466 <dl rel="yui:parameters"> |
|
467 <dt>Parameters:</dt> |
|
468 <dd rel="yui:parameter"> |
|
469 <code><span property="yui:name">type</span> |
|
470 <<span property="yui:type">string</span>> |
|
471 </code> |
|
472 <span property="yui:description"> The type, or name of the event</span> |
|
473 </dd> |
|
474 </dl> |
|
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 </div> |
|
481 |
|
482 </div> |
|
483 <hr /> |
|
484 </div> |
|
485 <div class="" rel="yui:method" resource="#method_fire"> |
|
486 <h4> |
|
487 <a name="method_fire">fire</a></h4> |
|
488 <div class="detail" > |
|
489 <code> |
|
490 |
|
491 |
|
492 |
|
493 Event.Target |
|
494 <strong property="yui:name">fire</strong> |
|
495 ( |
|
496 |
|
497 |
|
498 type |
|
499 |
|
500 |
|
501 , |
|
502 arguments |
|
503 |
|
504 |
|
505 ) |
|
506 </code> |
|
507 |
|
508 <div class="description" property="yui:description"> |
|
509 Fire a custom event by name. The callback functions will be executed |
|
510 from the context specified when the event was created, and with the |
|
511 following parameters. |
|
512 If the custom event object hasn't been created, then the event hasn't |
|
513 been published and it has no subscribers. For performance sake, we |
|
514 immediate exit in this case. This means the event won't bubble, so |
|
515 if the intention is that a bubble target be notified, the event must |
|
516 be published on this object first. |
|
517 The first argument is the event type, and any additional arguments are |
|
518 passed to the listeners as parameters. If the first of these is an |
|
519 object literal, and the event is configured to emit an event facade, |
|
520 that object is mixed into the event facade and the facade is provided |
|
521 in place of the original object. |
|
522 </div> |
|
523 |
|
524 <div class="description"> |
|
525 |
|
526 <dl rel="yui:parameters"> |
|
527 <dt>Parameters:</dt> |
|
528 <dd rel="yui:parameter"> |
|
529 <code><span property="yui:name">type</span> |
|
530 <<span property="yui:type">String|Object</span>> |
|
531 </code> |
|
532 <span property="yui:description"> The type of the event, or an object that contains |
|
533 a 'type' property.</span> |
|
534 </dd> |
|
535 <dd rel="yui:parameter"> |
|
536 <code><span property="yui:name">arguments</span> |
|
537 <<span property="yui:type">Object*</span>> |
|
538 </code> |
|
539 <span property="yui:description"> an arbitrary set of parameters to pass to |
|
540 the handler. If the first of these is an object literal and the event is |
|
541 configured to emit an event facade, the event facade will replace that |
|
542 parameter after the properties the object literal contains are copied to |
|
543 the event facade.</span> |
|
544 </dd> |
|
545 </dl> |
|
546 |
|
547 <dl> |
|
548 <dt>Returns: |
|
549 <code property="yui:return"> |
|
550 Event.Target |
|
551 </code></dt> |
|
552 <dd property="yui:returnInfo">the event host</dd> |
|
553 </dl> |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 </div> |
|
559 |
|
560 </div> |
|
561 <hr /> |
|
562 </div> |
|
563 <div class="" rel="yui:method" resource="#method_getEvent"> |
|
564 <h4> |
|
565 <a name="method_getEvent">getEvent</a></h4> |
|
566 <div class="detail" > |
|
567 <code> |
|
568 |
|
569 |
|
570 |
|
571 Event.Custom |
|
572 <strong property="yui:name">getEvent</strong> |
|
573 ( |
|
574 |
|
575 |
|
576 type |
|
577 |
|
578 |
|
579 , |
|
580 prefixed |
|
581 |
|
582 |
|
583 ) |
|
584 </code> |
|
585 |
|
586 <div class="description" property="yui:description"> |
|
587 Returns the custom event of the provided type has been created, a |
|
588 falsy value otherwise |
|
589 </div> |
|
590 |
|
591 <div class="description"> |
|
592 |
|
593 <dl rel="yui:parameters"> |
|
594 <dt>Parameters:</dt> |
|
595 <dd rel="yui:parameter"> |
|
596 <code><span property="yui:name">type</span> |
|
597 <<span property="yui:type">string</span>> |
|
598 </code> |
|
599 <span property="yui:description"> the type, or name of the event</span> |
|
600 </dd> |
|
601 <dd rel="yui:parameter"> |
|
602 <code><span property="yui:name">prefixed</span> |
|
603 <<span property="yui:type">string</span>> |
|
604 </code> |
|
605 <span property="yui:description"> if true, the type is prefixed already</span> |
|
606 </dd> |
|
607 </dl> |
|
608 |
|
609 <dl> |
|
610 <dt>Returns: |
|
611 <code property="yui:return"> |
|
612 Event.Custom |
|
613 </code></dt> |
|
614 <dd property="yui:returnInfo">the custom event or null</dd> |
|
615 </dl> |
|
616 |
|
617 |
|
618 |
|
619 |
|
620 </div> |
|
621 |
|
622 </div> |
|
623 <hr /> |
|
624 </div> |
|
625 <div class="" rel="yui:method" resource="#method_on"> |
|
626 <h4> |
|
627 <a name="method_on">on</a></h4> |
|
628 <div class="detail" > |
|
629 <code> |
|
630 |
|
631 |
|
632 |
|
633 |
|
634 <strong property="yui:name">on</strong> |
|
635 ( |
|
636 |
|
637 |
|
638 type |
|
639 |
|
640 |
|
641 , |
|
642 fn |
|
643 |
|
644 |
|
645 ) |
|
646 </code> |
|
647 |
|
648 <div class="description" property="yui:description"> |
|
649 Subscribe to a custom event hosted by this object |
|
650 </div> |
|
651 |
|
652 <div class="description"> |
|
653 |
|
654 <dl rel="yui:parameters"> |
|
655 <dt>Parameters:</dt> |
|
656 <dd rel="yui:parameter"> |
|
657 <code><span property="yui:name">type</span> |
|
658 <<span property="yui:type">string</span>> |
|
659 </code> |
|
660 <span property="yui:description"> The type of the event</span> |
|
661 </dd> |
|
662 <dd rel="yui:parameter"> |
|
663 <code><span property="yui:name">fn</span> |
|
664 <<span property="yui:type">Function</span>> |
|
665 </code> |
|
666 <span property="yui:description"> The callback</span> |
|
667 </dd> |
|
668 </dl> |
|
669 |
|
670 <dl> |
|
671 <dt>Returns: |
|
672 <code property="yui:return"> |
|
673 </code></dt> |
|
674 <dd property="yui:returnInfo">the event target or a detach handle per 'chain' config</dd> |
|
675 </dl> |
|
676 |
|
677 |
|
678 |
|
679 |
|
680 </div> |
|
681 |
|
682 </div> |
|
683 <hr /> |
|
684 </div> |
|
685 <div class="" rel="yui:method" resource="#method_publish"> |
|
686 <h4> |
|
687 <a name="method_publish">publish</a></h4> |
|
688 <div class="detail" > |
|
689 <code> |
|
690 |
|
691 |
|
692 |
|
693 Event.Custom |
|
694 <strong property="yui:name">publish</strong> |
|
695 ( |
|
696 |
|
697 |
|
698 type |
|
699 |
|
700 |
|
701 , |
|
702 opts |
|
703 |
|
704 |
|
705 ) |
|
706 </code> |
|
707 |
|
708 <div class="description" property="yui:description"> |
|
709 Creates a new custom event of the specified type. If a custom event |
|
710 by that name already exists, it will not be re-created. In either |
|
711 case the custom event is returned. |
|
712 </div> |
|
713 |
|
714 <div class="description"> |
|
715 |
|
716 <dl rel="yui:parameters"> |
|
717 <dt>Parameters:</dt> |
|
718 <dd rel="yui:parameter"> |
|
719 <code><span property="yui:name">type</span> |
|
720 <<span property="yui:type">string</span>> |
|
721 </code> |
|
722 <span property="yui:description"> the type, or name of the event</span> |
|
723 </dd> |
|
724 <dd rel="yui:parameter"> |
|
725 <code><span property="yui:name">opts</span> |
|
726 <<span property="yui:type">object</span>> |
|
727 </code> |
|
728 <span property="yui:description"> optional config params. Valid properties are: |
|
729 <ul> |
|
730 <li> |
|
731 'broadcast': whether or not the YUI instance and YUI global are notified when the event is fired (false) |
|
732 </li> |
|
733 <li> |
|
734 'bubbles': whether or not this event bubbles (true) |
|
735 </li> |
|
736 <li> |
|
737 'context': the default execution context for the listeners (this) |
|
738 </li> |
|
739 <li> |
|
740 'defaultFn': the default function to execute when this event fires if preventDefault was not called |
|
741 </li> |
|
742 <li> |
|
743 'emitFacade': whether or not this event emits a facade (false) |
|
744 </li> |
|
745 <li> |
|
746 'prefix': the prefix for this targets events, e.g., 'menu' in 'menu:click' |
|
747 </li> |
|
748 <li> |
|
749 'fireOnce': if an event is configured to fire once, new subscribers after |
|
750 the fire will be notified immediately. |
|
751 </li> |
|
752 <li> |
|
753 'preventable': whether or not preventDefault() has an effect (true) |
|
754 </li> |
|
755 <li> |
|
756 'preventedFn': a function that is executed when preventDefault is called |
|
757 </li> |
|
758 <li> |
|
759 'queuable': whether or not this event can be queued during bubbling (false) |
|
760 </li> |
|
761 <li> |
|
762 'silent': if silent is true, debug messages are not provided for this event. |
|
763 </li> |
|
764 <li> |
|
765 'stoppedFn': a function that is executed when stopPropagation is called |
|
766 </li> |
|
767 <li> |
|
768 'type': the event type (valid option if not provided as the first parameter to publish) |
|
769 </li> |
|
770 </ul></span> |
|
771 </dd> |
|
772 </dl> |
|
773 |
|
774 <dl> |
|
775 <dt>Returns: |
|
776 <code property="yui:return"> |
|
777 Event.Custom |
|
778 </code></dt> |
|
779 <dd property="yui:returnInfo">the custom event</dd> |
|
780 </dl> |
|
781 |
|
782 |
|
783 |
|
784 |
|
785 </div> |
|
786 |
|
787 </div> |
|
788 <hr /> |
|
789 </div> |
|
790 <div class="" rel="yui:method" resource="#method_removeTarget"> |
|
791 <h4> |
|
792 <a name="method_removeTarget">removeTarget</a></h4> |
|
793 <div class="detail" > |
|
794 <code> |
|
795 |
|
796 |
|
797 |
|
798 void |
|
799 <strong property="yui:name">removeTarget</strong> |
|
800 ( |
|
801 |
|
802 |
|
803 o |
|
804 |
|
805 |
|
806 ) |
|
807 </code> |
|
808 |
|
809 <div class="description" property="yui:description"> |
|
810 Removes a bubble target |
|
811 </div> |
|
812 |
|
813 <div class="description"> |
|
814 |
|
815 <dl rel="yui:parameters"> |
|
816 <dt>Parameters:</dt> |
|
817 <dd rel="yui:parameter"> |
|
818 <code><span property="yui:name">o</span> |
|
819 <<span property="yui:type">EventTarget</span>> |
|
820 </code> |
|
821 <span property="yui:description"> the target to remove</span> |
|
822 </dd> |
|
823 </dl> |
|
824 |
|
825 |
|
826 |
|
827 |
|
828 |
|
829 </div> |
|
830 |
|
831 </div> |
|
832 <hr /> |
|
833 </div> |
|
834 <div class=" deprecated" rel="yui:method" resource="#method_subscribe"> |
|
835 <h4> |
|
836 <a name="method_subscribe">subscribe</a></h4> |
|
837 <div class="detail" > |
|
838 <code> |
|
839 |
|
840 |
|
841 |
|
842 void |
|
843 <strong property="yui:name">subscribe</strong> |
|
844 ( |
|
845 ) |
|
846 </code> |
|
847 |
|
848 <div class="description" property="yui:description"> |
|
849 subscribe to an event |
|
850 </div> |
|
851 |
|
852 <div class="description"> |
|
853 |
|
854 |
|
855 |
|
856 |
|
857 |
|
858 <div class="deprecated"> |
|
859 <strong>Deprecated</strong> use on |
|
860 </div> |
|
861 |
|
862 </div> |
|
863 |
|
864 </div> |
|
865 <hr /> |
|
866 </div> |
|
867 <div class=" deprecated" rel="yui:method" resource="#method_unsubscribe"> |
|
868 <h4> |
|
869 <a name="method_unsubscribe">unsubscribe</a></h4> |
|
870 <div class="detail" > |
|
871 <code> |
|
872 |
|
873 |
|
874 |
|
875 void |
|
876 <strong property="yui:name">unsubscribe</strong> |
|
877 ( |
|
878 ) |
|
879 </code> |
|
880 |
|
881 <div class="description" property="yui:description"> |
|
882 detach a listener |
|
883 </div> |
|
884 |
|
885 <div class="description"> |
|
886 |
|
887 |
|
888 |
|
889 |
|
890 |
|
891 <div class="deprecated"> |
|
892 <strong>Deprecated</strong> use detach |
|
893 </div> |
|
894 |
|
895 </div> |
|
896 |
|
897 </div> |
|
898 <hr /> |
|
899 </div> |
|
900 <div class=" deprecated" rel="yui:method" resource="#method_unsubscribeAll"> |
|
901 <h4> |
|
902 <a name="method_unsubscribeAll">unsubscribeAll</a></h4> |
|
903 <div class="detail" > |
|
904 <code> |
|
905 |
|
906 |
|
907 |
|
908 void |
|
909 <strong property="yui:name">unsubscribeAll</strong> |
|
910 ( |
|
911 |
|
912 |
|
913 type |
|
914 |
|
915 |
|
916 ) |
|
917 </code> |
|
918 |
|
919 <div class="description" property="yui:description"> |
|
920 Removes all listeners from the specified event. If the event type |
|
921 is not specified, all listeners from all hosted custom events will |
|
922 be removed. |
|
923 </div> |
|
924 |
|
925 <div class="description"> |
|
926 |
|
927 <dl rel="yui:parameters"> |
|
928 <dt>Parameters:</dt> |
|
929 <dd rel="yui:parameter"> |
|
930 <code><span property="yui:name">type</span> |
|
931 <<span property="yui:type">string</span>> |
|
932 </code> |
|
933 <span property="yui:description"> The type, or name of the event</span> |
|
934 </dd> |
|
935 </dl> |
|
936 |
|
937 |
|
938 |
|
939 |
|
940 <div class="deprecated"> |
|
941 <strong>Deprecated</strong> use detachAll |
|
942 </div> |
|
943 |
|
944 </div> |
|
945 |
|
946 </div> |
|
947 <hr /> |
|
948 </div> |
|
949 </div> |
|
950 </div> |
|
951 |
|
952 </div> |
|
953 |
|
954 <div rel="yui:events" resource="#events"> |
|
955 |
|
956 |
|
957 </div> |
|
958 |
|
959 <div rel="yui:attributes" resource="#configattributes"> |
|
960 |
|
961 </div> |
|
962 |
|
963 </div> |
|
964 </div> |
|
965 <div class="yui-b"> |
|
966 <div class="nav"> |
|
967 |
|
968 <div id="moduleList" class="module"> |
|
969 <h4>Modules</h4> |
|
970 <ul class="content"> |
|
971 <li class=""><a href="module_anim.html" title="anim">anim</a></li> |
|
972 <li class=""><a href="module_async-queue.html" title="async-queue">async-queue</a></li> |
|
973 <li class=""><a href="module_attribute.html" title="attribute">attribute</a></li> |
|
974 <li class=""><a href="module_base.html" title="base">base</a></li> |
|
975 <li class=""><a href="module_cache.html" title="cache">cache</a></li> |
|
976 <li class=""><a href="module_classnamemanager.html" title="classnamemanager">classnamemanager</a></li> |
|
977 <li class=""><a href="module_collection.html" title="collection">collection</a></li> |
|
978 <li class=""><a href="module_console.html" title="console">console</a></li> |
|
979 <li class=""><a href="module_console-filters.html" title="console-filters">console-filters</a></li> |
|
980 <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li> |
|
981 <li class=""><a href="module_dataschema.html" title="dataschema">dataschema</a></li> |
|
982 <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li> |
|
983 <li class=""><a href="module_datatype.html" title="datatype">datatype</a></li> |
|
984 <li class=""><a href="module_dd.html" title="dd">dd</a></li> |
|
985 <li class=""><a href="module_dom.html" title="dom">dom</a></li> |
|
986 <li class=""><a href="module_dump.html" title="dump">dump</a></li> |
|
987 <li class=""><a href="module_event.html" title="event">event</a></li> |
|
988 <li class="selected"><a href="module_event-custom.html" title="event-custom">event-custom</a></li> |
|
989 <li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li> |
|
990 <li class=""><a href="module_history.html" title="history">history</a></li> |
|
991 <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li> |
|
992 <li class=""><a href="module_io.html" title="io">io</a></li> |
|
993 <li class=""><a href="module_json.html" title="json">json</a></li> |
|
994 <li class=""><a href="module_node.html" title="node">node</a></li> |
|
995 <li class=""><a href="module_node-focusmanager.html" title="node-focusmanager">node-focusmanager</a></li> |
|
996 <li class=""><a href="module_node-menunav.html" title="node-menunav">node-menunav</a></li> |
|
997 <li class=""><a href="module_oop.html" title="oop">oop</a></li> |
|
998 <li class=""><a href="module_overlay.html" title="overlay">overlay</a></li> |
|
999 <li class=""><a href="module_plugin.html" title="plugin">plugin</a></li> |
|
1000 <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li> |
|
1001 <li class=""><a href="module_queue-promote.html" title="queue-promote">queue-promote</a></li> |
|
1002 <li class=""><a href="module_slider.html" title="slider">slider</a></li> |
|
1003 <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li> |
|
1004 <li class=""><a href="module_substitute.html" title="substitute">substitute</a></li> |
|
1005 <li class=""><a href="module_test.html" title="test">test</a></li> |
|
1006 <li class=""><a href="module_widget.html" title="widget">widget</a></li> |
|
1007 <li class=""><a href="module_widget-position.html" title="widget-position">widget-position</a></li> |
|
1008 <li class=""><a href="module_widget-position-ext.html" title="widget-position-ext">widget-position-ext</a></li> |
|
1009 <li class=""><a href="module_widget-stack.html" title="widget-stack">widget-stack</a></li> |
|
1010 <li class=""><a href="module_widget-stdmod.html" title="widget-stdmod">widget-stdmod</a></li> |
|
1011 <li class=""><a href="module_yui.html" title="yui">yui</a></li> |
|
1012 </ul> |
|
1013 </div> |
|
1014 |
|
1015 <div id="classList" class="module"> |
|
1016 <h4>Classes</h4> |
|
1017 <ul class="content"> |
|
1018 <li class=""><a href="CustomEvent.html" title="CustomEvent">CustomEvent</a></li> |
|
1019 <li class=""><a href="Do.html" title="Do">Do</a></li> |
|
1020 <li class=""><a href="Do.AlterArgs.html" title="Do.AlterArgs">Do.AlterArgs</a></li> |
|
1021 <li class=""><a href="Do.AlterReturn.html" title="Do.AlterReturn">Do.AlterReturn</a></li> |
|
1022 <li class=""><a href="Do.Error.html" title="Do.Error">Do.Error</a></li> |
|
1023 <li class=""><a href="Do.Halt.html" title="Do.Halt">Do.Halt</a></li> |
|
1024 <li class=""><a href="Do.Method.html" title="Do.Method">Do.Method</a></li> |
|
1025 <li class=""><a href="Do.Prevent.html" title="Do.Prevent">Do.Prevent</a></li> |
|
1026 <li class=""><a href="EventFacade.html" title="EventFacade">EventFacade</a></li> |
|
1027 <li class=""><a href="EventHandle.html" title="EventHandle">EventHandle</a></li> |
|
1028 <li class="selected"><a href="EventTarget.html" title="EventTarget">EventTarget</a></li> |
|
1029 <li class=""><a href="Subscriber.html" title="Subscriber">Subscriber</a></li> |
|
1030 </ul> |
|
1031 </div> |
|
1032 |
|
1033 <div id="fileList" class="module"> |
|
1034 <h4>Files</h4> |
|
1035 <ul class="content"> |
|
1036 <li class=""><a href="event-custom.js.html" title="event-custom.js">event-custom.js</a></li> |
|
1037 <li class=""><a href="event-do.js.html" title="event-do.js">event-do.js</a></li> |
|
1038 <li class=""><a href="event-facade.js.html" title="event-facade.js">event-facade.js</a></li> |
|
1039 <li class=""><a href="event-target.js.html" title="event-target.js">event-target.js</a></li> |
|
1040 <li class=""><a href="event.js.html" title="event.js">event.js</a></li> |
|
1041 </ul> |
|
1042 </div> |
|
1043 |
|
1044 |
|
1045 <div id="methodsList" class="module"> |
|
1046 <h4>Methods</h4> |
|
1047 <ul class="content"> |
|
1048 <li class="private"><a href="#method__getType" title="_getType">_getType</a></li> |
|
1049 <li class="private"><a href="#method__parseType" title="_parseType">_parseType</a></li> |
|
1050 <li class=""><a href="#method_addTarget" title="addTarget">addTarget</a></li> |
|
1051 <li class=""><a href="#method_after" title="after">after</a></li> |
|
1052 <li class=" deprecated"><a href="#method_before" title="before">before</a></li> |
|
1053 <li class=""><a href="#method_bubble" title="bubble">bubble</a></li> |
|
1054 <li class=""><a href="#method_detach" title="detach">detach</a></li> |
|
1055 <li class=""><a href="#method_detachAll" title="detachAll">detachAll</a></li> |
|
1056 <li class=""><a href="#method_fire" title="fire">fire</a></li> |
|
1057 <li class=""><a href="#method_getEvent" title="getEvent">getEvent</a></li> |
|
1058 <li class=""><a href="#method_on" title="on">on</a></li> |
|
1059 <li class=""><a href="#method_publish" title="publish">publish</a></li> |
|
1060 <li class=""><a href="#method_removeTarget" title="removeTarget">removeTarget</a></li> |
|
1061 <li class=" deprecated"><a href="#method_subscribe" title="subscribe">subscribe</a></li> |
|
1062 <li class=" deprecated"><a href="#method_unsubscribe" title="unsubscribe">unsubscribe</a></li> |
|
1063 <li class=" deprecated"><a href="#method_unsubscribeAll" title="unsubscribeAll">unsubscribeAll</a></li> |
|
1064 </ul> |
|
1065 </div> |
|
1066 |
|
1067 |
|
1068 |
|
1069 </div> |
|
1070 </div> |
|
1071 </div> |
|
1072 <div id="ft"> |
|
1073 <hr /> |
|
1074 Copyright © 2009 Yahoo! Inc. All rights reserved. |
|
1075 </div> |
|
1076 </div> |
|
1077 <script type="text/javascript"> |
|
1078 ALL_YUI_PROPS = [{"access": "", "host": "EventTarget", "name": "addTarget", "url": "EventTarget.html#method_addTarget", "type": "method"}, {"access": "", "host": "EventTarget", "name": "after", "url": "EventTarget.html#method_after", "type": "method"}, {"access": "", "host": "EventTarget", "name": "before", "url": "EventTarget.html#method_before", "type": "method"}, {"access": "", "host": "EventTarget", "name": "bubble", "url": "EventTarget.html#method_bubble", "type": "method"}, {"access": "", "host": "EventFacade", "name": "currentTarget", "url": "EventFacade.html#property_currentTarget", "type": "property"}, {"access": "", "host": "EventTarget", "name": "detach", "url": "EventTarget.html#method_detach", "type": "method"}, {"access": "", "host": "EventTarget", "name": "detachAll", "url": "EventTarget.html#method_detachAll", "type": "method"}, {"access": "", "host": "EventFacade", "name": "details", "url": "EventFacade.html#property_details", "type": "property"}, {"access": "", "host": "EventTarget", "name": "fire", "url": "EventTarget.html#method_fire", "type": "method"}, {"access": "", "host": "EventTarget", "name": "getEvent", "url": "EventTarget.html#method_getEvent", "type": "method"}, {"access": "private", "host": "EventTarget", "name": "_getType", "url": "EventTarget.html#method__getType", "type": "method"}, {"access": "", "host": "EventFacade", "name": "halt", "url": "EventFacade.html#method_halt", "type": "method"}, {"access": "", "host": "EventTarget", "name": "on", "url": "EventTarget.html#method_on", "type": "method"}, {"access": "private", "host": "EventTarget", "name": "_parseType", "url": "EventTarget.html#method__parseType", "type": "method"}, {"access": "", "host": "EventFacade", "name": "preventDefault", "url": "EventFacade.html#method_preventDefault", "type": "method"}, {"access": "", "host": "EventTarget", "name": "publish", "url": "EventTarget.html#method_publish", "type": "method"}, {"access": "", "host": "EventFacade", "name": "relatedTarget", "url": "EventFacade.html#property_relatedTarget", "type": "property"}, {"access": "", "host": "EventTarget", "name": "removeTarget", "url": "EventTarget.html#method_removeTarget", "type": "method"}, {"access": "", "host": "EventFacade", "name": "stopImmediatePropagation", "url": "EventFacade.html#method_stopImmediatePropagation", "type": "method"}, {"access": "", "host": "EventFacade", "name": "stopPropagation", "url": "EventFacade.html#method_stopPropagation", "type": "method"}, {"access": "", "host": "EventTarget", "name": "subscribe", "url": "EventTarget.html#method_subscribe", "type": "method"}, {"access": "", "host": "EventFacade", "name": "target", "url": "EventFacade.html#property_target", "type": "property"}, {"access": "", "host": "EventFacade", "name": "type", "url": "EventFacade.html#property_type", "type": "property"}, {"access": "", "host": "EventTarget", "name": "unsubscribe", "url": "EventTarget.html#method_unsubscribe", "type": "method"}, {"access": "", "host": "EventTarget", "name": "unsubscribeAll", "url": "EventTarget.html#method_unsubscribeAll", "type": "method"}]; |
|
1079 </script> |
|
1080 </body> |
|
1081 </html> |