Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Side by Side Diff: tools/dom/templates/html/impl/impl_EventTarget.darttemplate

Issue 365083006: Fixed example in dart:html Events (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 /** 7 /**
8 * Base class that supports listening for and dispatching browser events. 8 * Base class that supports listening for and dispatching browser events.
9 * 9 *
10 * Normally events are accessed via the Stream getter: 10 * Normally events are accessed via the Stream getter:
11 * 11 *
12 * element.onMouseOver.listen((e) => print('Mouse over!')); 12 * element.onMouseOver.listen((e) => print('Mouse over!'));
13 * 13 *
14 * To access bubbling events which are declared on one element, but may bubble 14 * To access bubbling events which are declared on one element, but may bubble
15 * up to another element type (common for MediaElement events): 15 * up to another element type (common for MediaElement events):
16 * 16 *
17 * MediaElement.pauseEvent.forTarget(document.body).listen(...); 17 * MediaElement.pauseEvent.forTarget(document.body).listen(...);
18 * 18 *
19 * To useCapture on events: 19 * To useCapture on events:
20 * 20 *
21 * Element.keyDownEvent.forTarget(element, useCapture: true).listen(...); 21 * Element.keyDownEvent.forTarget(element, useCapture: true).listen(...);
22 * 22 *
23 * Custom events can be declared as: 23 * Custom events can be declared as:
24 * 24 *
25 * class DataGenerator { 25 * class DataGenerator {
26 * static EventStreamProvider<Event> dataEvent = 26 * static EventStreamProvider<Event> dataEvent =
27 * new EventStreamProvider('data'); 27 * new EventStreamProvider('data');
28 * } 28 * }
29 * 29 *
30 * Then listeners should access the event with: 30 * Then listeners should access the event with:
31 * 31 *
32 * DataGenerator.dataEvent.forTarget(element).listen(...); 32 * DataGenerator.dataEvent.forTarget(element).listen(...);
33 * 33 *
34 * Custom events can also be accessed as: 34 * Custom events can also be accessed as:
35 * 35 *
36 * element.on['some_event'].listen(...); 36 * element.on['some_event'].listen(...);
37 * 37 *
38 * This approach is generally discouraged as it loses the event typing and 38 * This approach is generally discouraged as it loses the event typing and
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // Custom element created callback. 95 // Custom element created callback.
96 EventTarget._created(); 96 EventTarget._created();
97 97
98 /** 98 /**
99 * This is an ease-of-use accessor for event streams which should only be 99 * This is an ease-of-use accessor for event streams which should only be
100 * used when an explicit accessor is not available. 100 * used when an explicit accessor is not available.
101 */ 101 */
102 Events get on => new Events(this); 102 Events get on => new Events(this);
103 $!MEMBERS 103 $!MEMBERS
104 } 104 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698