OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // <include src="assert.js"> | 5 // <include src="assert.js"> |
6 | 6 |
7 /** | 7 /** |
8 * Alias for document.getElementById. Found elements must be HTMLElements. | 8 * Alias for document.getElementById. Found elements must be HTMLElements. |
9 * @param {string} id The ID of the element to find. | 9 * @param {string} id The ID of the element to find. |
10 * @return {HTMLElement} The found element or null if not found. | 10 * @return {HTMLElement} The found element or null if not found. |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 * @param {!Array<string>} moduleNames | 493 * @param {!Array<string>} moduleNames |
494 * @return {!Promise} | 494 * @return {!Promise} |
495 */ | 495 */ |
496 function importModules(moduleNames) { | 496 function importModules(moduleNames) { |
497 return new Promise(function(resolve) { | 497 return new Promise(function(resolve) { |
498 define(moduleNames, function() { | 498 define(moduleNames, function() { |
499 resolve(Array.from(arguments)); | 499 resolve(Array.from(arguments)); |
500 }); | 500 }); |
501 }); | 501 }); |
502 } | 502 } |
| 503 |
| 504 /** |
| 505 * @param {!Event} e |
| 506 * @return {boolean} Whether a modifier key was down when processing |e|. |
| 507 */ |
| 508 function hasKeyModifiers(e) { |
| 509 return !!(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey); |
| 510 } |
OLD | NEW |