Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: remoting/webapp/crd/js/event_handlers.js

Issue 917093003: Shorten Closure template notation from Array.<*> to Array<*>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove cvox Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * @param {Array.<{event: string, id: string, 8 * @param {Array<{event: string, id: string,
9 * fn: function(Event):void}>} actions Array of actions to register. 9 * fn: function(Event):void}>} actions Array of actions to register.
10 */ 10 */
11 function registerEventListeners(actions) { 11 function registerEventListeners(actions) {
12 for (var i = 0; i < actions.length; ++i) { 12 for (var i = 0; i < actions.length; ++i) {
13 var action = actions[i]; 13 var action = actions[i];
14 registerEventListener(action.id, action.event, action.fn); 14 registerEventListener(action.id, action.event, action.fn);
15 } 15 }
16 } 16 }
17 17
18 /** 18 /**
19 * Add an event listener to the specified element. 19 * Add an event listener to the specified element.
20 * @param {string} id Id of element. 20 * @param {string} id Id of element.
21 * @param {string} eventname Event name. 21 * @param {string} eventname Event name.
22 * @param {function(Event):void} fn Event handler. 22 * @param {function(Event):void} fn Event handler.
23 */ 23 */
24 function registerEventListener(id, eventname, fn) { 24 function registerEventListener(id, eventname, fn) {
25 var element = document.getElementById(id); 25 var element = document.getElementById(id);
26 if (element) { 26 if (element) {
27 element.addEventListener(eventname, fn, false); 27 element.addEventListener(eventname, fn, false);
28 } else { 28 } else {
29 console.error('Could not set ' + eventname + 29 console.error('Could not set ' + eventname +
30 ' event handler on element ' + id + 30 ' event handler on element ' + id +
31 ': element not found.'); 31 ': element not found.');
32 } 32 }
33 } 33 }
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/desktop_connected_view.js ('k') | remoting/webapp/crd/js/fallback_signal_strategy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698