| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 @license | 2 @license |
| 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 --> | 9 --> |
| 10 | 10 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 * and uses an expressive syntax to filter key presses. | 233 * and uses an expressive syntax to filter key presses. |
| 234 * | 234 * |
| 235 * Use the `keyBindings` prototype property to express what combination of k
eys | 235 * Use the `keyBindings` prototype property to express what combination of k
eys |
| 236 * will trigger the event to fire. | 236 * will trigger the event to fire. |
| 237 * | 237 * |
| 238 * Use the `key-event-target` attribute to set up event handlers on a specif
ic | 238 * Use the `key-event-target` attribute to set up event handlers on a specif
ic |
| 239 * node. | 239 * node. |
| 240 * The `keys-pressed` event will fire when one of the key combinations set w
ith the | 240 * The `keys-pressed` event will fire when one of the key combinations set w
ith the |
| 241 * `keys` property is pressed. | 241 * `keys` property is pressed. |
| 242 * | 242 * |
| 243 * @demo demo/index.html |
| 243 * @polymerBehavior IronA11yKeysBehavior | 244 * @polymerBehavior IronA11yKeysBehavior |
| 244 */ | 245 */ |
| 245 Polymer.IronA11yKeysBehavior = { | 246 Polymer.IronA11yKeysBehavior = { |
| 246 properties: { | 247 properties: { |
| 247 /** | 248 /** |
| 248 * The HTMLElement that will be firing relevant KeyboardEvents. | 249 * The HTMLElement that will be firing relevant KeyboardEvents. |
| 249 */ | 250 */ |
| 250 keyEventTarget: { | 251 keyEventTarget: { |
| 251 type: Object, | 252 type: Object, |
| 252 value: function() { | 253 value: function() { |
| 253 return this; | 254 return this; |
| 254 } | 255 } |
| 255 }, | 256 }, |
| 256 | 257 |
| 257 _boundKeyHandlers: { | 258 _boundKeyHandlers: { |
| 259 type: Array, |
| 258 value: function() { | 260 value: function() { |
| 259 return []; | 261 return []; |
| 260 } | 262 } |
| 261 }, | 263 }, |
| 262 | 264 |
| 263 // We use this due to a limitation in IE10 where instances will have | 265 // We use this due to a limitation in IE10 where instances will have |
| 264 // own properties of everything on the "prototype". | 266 // own properties of everything on the "prototype". |
| 265 _imperativeKeyBindings: { | 267 _imperativeKeyBindings: { |
| 268 type: Object, |
| 266 value: function() { | 269 value: function() { |
| 267 return {}; | 270 return {}; |
| 268 } | 271 } |
| 269 } | 272 } |
| 270 }, | 273 }, |
| 271 | 274 |
| 272 observers: [ | 275 observers: [ |
| 273 '_resetKeyEventListeners(keyEventTarget, _boundKeyHandlers)' | 276 '_resetKeyEventListeners(keyEventTarget, _boundKeyHandlers)' |
| 274 ], | 277 ], |
| 275 | 278 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 var detail = Object.create(keyCombo); | 412 var detail = Object.create(keyCombo); |
| 410 detail.keyboardEvent = keyboardEvent; | 413 detail.keyboardEvent = keyboardEvent; |
| 411 | 414 |
| 412 this[handlerName].call(this, new CustomEvent(keyCombo.event, { | 415 this[handlerName].call(this, new CustomEvent(keyCombo.event, { |
| 413 detail: detail | 416 detail: detail |
| 414 })); | 417 })); |
| 415 } | 418 } |
| 416 }; | 419 }; |
| 417 })(); | 420 })(); |
| 418 </script> | 421 </script> |
| OLD | NEW |