Skip to content

Commit c8cde9b

Browse files
committed
Refactor events feature
Allow behaviors to easily override event listener creation Expose a Behavior Use a coarse mouse on/off feature for handling synthetic mouse events and ghost clicks Implement all in the burndown list Add a smoke test only handle one finger with touchevents Make sure track state can be "start" for mouse Minor fix for touchevent single-finger check bolt basic gestures onto core add tests for gesture private data tracking
1 parent e32402c commit c8cde9b

File tree

7 files changed

+606
-371
lines changed

7 files changed

+606
-371
lines changed

polymer.html

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
<link rel="import" href="src/standard/annotations.html">
1414
<link rel="import" href="src/standard/events.html">
15+
<link rel="import" href="src/standard/gestures.html">
1516
<link rel="import" href="src/standard/utils.html">
1617
<link rel="import" href="src/standard/effects.html">
1718
<link rel="import" href="src/standard/configure.html">

src/lib/gestures.html

-284
This file was deleted.

src/standard/events.html

+10-27
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,26 @@
88
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
99
-->
1010

11-
<link rel="import" href="../lib/gestures.html">
12-
1311
<script>
1412

1513
/**
16-
* Supports `listeners` and `keyPresses` objects.
14+
* Supports `listeners` object.
1715
*
1816
* Example:
1917
*
20-
* using('Base', function(Base) {
21-
*
22-
* Polymer({
23-
*
24-
* listeners: {
25-
* // `click` events on the host are delegated to `clickHandler`
26-
* 'click': 'clickHandler'
27-
* },
2818
*
29-
* keyPresses: {
30-
* // 'ESC' key presses are delegated to `escHandler`
31-
* Base.ESC_KEY: 'escHandler'
32-
* },
19+
* Polymer({
3320
*
34-
* ...
21+
* listeners: {
22+
* // `click` events on the host are delegated to `clickHandler`
23+
* 'click': 'clickHandler'
24+
* },
3525
*
36-
* });
26+
* ...
3727
*
3828
* });
3929
*
30+
*
4031
* @class standard feature: events
4132
*
4233
*/
@@ -77,18 +68,10 @@
7768
},
7869

7970
_listen: function(node, eventName, handler) {
80-
switch (eventName) {
81-
case 'tap':
82-
case 'track':
83-
Polymer.Gestures.add(eventName, node, handler);
84-
break;
85-
86-
default:
87-
node.addEventListener(eventName, handler);
88-
break;
89-
}
71+
node.addEventListener(eventName, handler);
9072
},
9173

74+
// TODO(dfreedm): remove when a11y keys element is ported
9275
keyCodes: {
9376
ESC_KEY: 27,
9477
ENTER_KEY: 13,

0 commit comments

Comments
 (0)