OLD | NEW |
1 <!-- | 1 <!-- |
2 @license | 2 @license |
3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. |
4 This code may only be used under the BSD style license found at http://polym
er.github.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polym
er.github.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/CO
NTRIBUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CO
NTRIBUTORS.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/P
ATENTS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/P
ATENTS.txt |
9 --> | 9 --> |
10 | 10 |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 if (!this.target) { | 296 if (!this.target) { |
297 this.target = this.parentNode; | 297 this.target = this.parentNode; |
298 } | 298 } |
299 listen(this.target, this._keyHandler); | 299 listen(this.target, this._keyHandler); |
300 }, | 300 }, |
301 detached: function() { | 301 detached: function() { |
302 unlisten(this.target, this._keyHandler); | 302 unlisten(this.target, this._keyHandler); |
303 }, | 303 }, |
304 publish: { | 304 publish: { |
305 /** | 305 /** |
306 * The set of key combinations to listen for. | 306 * The set of key combinations that will be matched (in keys syntax). |
307 * | 307 * |
308 * @attribute keys | 308 * @attribute keys |
309 * @type string (keys syntax) | 309 * @type string |
310 * @default '' | 310 * @default '' |
311 */ | 311 */ |
312 keys: '', | 312 keys: '', |
313 /** | 313 /** |
314 * The node that will fire keyboard events. | 314 * The node that will fire keyboard events. |
315 * Default to this element's parentNode unless one is assigned | 315 * Default to this element's parentNode unless one is assigned |
316 * | 316 * |
317 * @attribute target | 317 * @attribute target |
318 * @type Node | 318 * @type Node |
319 * @default this.parentNode | 319 * @default this.parentNode |
320 */ | 320 */ |
321 target: null | 321 target: null |
322 }, | 322 }, |
323 keysChanged: function() { | 323 keysChanged: function() { |
324 // * can have multiple mappings: shift+8, * on numpad or Multiply on num
pad | 324 // * can have multiple mappings: shift+8, * on numpad or Multiply on num
pad |
325 var normalized = this.keys.replace('*', '* shift+*'); | 325 var normalized = this.keys.replace('*', '* shift+*'); |
326 this._desiredKeys = normalized.toLowerCase().split(' ').map(stringToKey)
; | 326 this._desiredKeys = normalized.toLowerCase().split(' ').map(stringToKey)
; |
327 }, | 327 }, |
328 targetChanged: function(oldTarget) { | 328 targetChanged: function(oldTarget) { |
329 unlisten(oldTarget, this._keyHandler); | 329 unlisten(oldTarget, this._keyHandler); |
330 listen(this.target, this._keyHandler); | 330 listen(this.target, this._keyHandler); |
331 } | 331 } |
332 }); | 332 }); |
333 })(); | 333 })(); |
334 </script> | 334 </script> |
335 </polymer-element> | 335 </polymer-element> |
OLD | NEW |