OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 } else | 389 } else |
390 this.hide(); | 390 this.hide(); |
391 }, | 391 }, |
392 | 392 |
393 /** | 393 /** |
394 * @param {!KeyboardEvent} event | 394 * @param {!KeyboardEvent} event |
395 * @return {boolean} | 395 * @return {boolean} |
396 */ | 396 */ |
397 keyPressed: function(event) | 397 keyPressed: function(event) |
398 { | 398 { |
399 switch (event.keyIdentifier) { | 399 switch (event.key) { |
400 case "Up": | 400 case "ArrowUp": |
401 return this.upKeyPressed(); | 401 return this.upKeyPressed(); |
402 case "Down": | 402 case "ArrowDown": |
403 return this.downKeyPressed(); | 403 return this.downKeyPressed(); |
404 case "PageUp": | 404 case "PageUp": |
405 return this.pageUpKeyPressed(); | 405 return this.pageUpKeyPressed(); |
406 case "PageDown": | 406 case "PageDown": |
407 return this.pageDownKeyPressed(); | 407 return this.pageDownKeyPressed(); |
408 case "Enter": | 408 case "Enter": |
409 return this.enterKeyPressed(); | 409 return this.enterKeyPressed(); |
410 } | 410 } |
411 return false; | 411 return false; |
412 }, | 412 }, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 this.element.style.top = containerBox.y + "px"; | 519 this.element.style.top = containerBox.y + "px"; |
520 this.element.style.height = containerBox.height + "px"; | 520 this.element.style.height = containerBox.height + "px"; |
521 this.element.style.width = containerBox.width + "px"; | 521 this.element.style.width = containerBox.width + "px"; |
522 }, | 522 }, |
523 | 523 |
524 dispose: function() | 524 dispose: function() |
525 { | 525 { |
526 this.element.remove(); | 526 this.element.remove(); |
527 } | 527 } |
528 } | 528 } |
OLD | NEW |