Skip to content

Commit

Permalink
[Chromoting] Separate the click event handlers from the other event h…
Browse files Browse the repository at this point in the history
…andlers.

This breaks the webapp's initEventHandlers into two functions:
  initClickEventHandlers - for handling UI button clicks
  initEventHandlers - for other events (resize, load/unload)

NOTRY=True
BUG=

Review URL: https://codereview.chromium.org/766703005

Cr-Commit-Position: refs/heads/master@{#306912}
  • Loading branch information
garykac authored and Commit bot committed Dec 4, 2014
1 parent 997c881 commit 258cddf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion remoting/webapp/crd/js/crd_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ remoting.initChromoting = function() {
remoting.initIdentity();
remoting.initIdentityEmail(remoting.onEmailAvailable);

remoting.initEventHandlers();
remoting.initElementEventHandlers();
remoting.initGlobalEventHandlers();

if (base.isAppsV2()) {
remoting.fullscreen = new remoting.FullscreenAppsV2();
Expand Down
4 changes: 3 additions & 1 deletion remoting/webapp/crd/js/event_handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/** @suppress {duplicate} */
var remoting = remoting || {};

remoting.initEventHandlers = function() {
remoting.initElementEventHandlers = function() {
var goHome = function() {
remoting.setMode(remoting.AppMode.HOME);
};
Expand Down Expand Up @@ -115,7 +115,9 @@ remoting.initEventHandlers = function() {
registerEventListeners(me2me_actions);
registerEventListeners(host_actions);
registerEventListeners(auth_actions);
}

remoting.initGlobalEventHandlers = function() {
window.addEventListener('resize', remoting.onResize, false);
// When a window goes full-screen, a resize event is triggered, but the
// Fullscreen.isActive call is not guaranteed to return true until the
Expand Down

0 comments on commit 258cddf

Please sign in to comment.