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 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * Functions related to controlling the modal UI state of the app. UI states | 7 * Functions related to controlling the modal UI state of the app. UI states |
8 * are expressed as HTML attributes with a dotted hierarchy. For example, the | 8 * are expressed as HTML attributes with a dotted hierarchy. For example, the |
9 * string 'host.shared' will match any elements with an associated attribute | 9 * string 'host.shared' will match any elements with an associated attribute |
10 * of 'host' or 'host.shared', showing those elements and hiding all others. | 10 * of 'host' or 'host.shared', showing those elements and hiding all others. |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 if (mode == remoting.AppMode.IN_SESSION) { | 121 if (mode == remoting.AppMode.IN_SESSION) { |
122 document.removeEventListener('keydown', remoting.ConnectionStats.onKeydown, | 122 document.removeEventListener('keydown', remoting.ConnectionStats.onKeydown, |
123 false); | 123 false); |
124 document.addEventListener('webkitvisibilitychange', | 124 document.addEventListener('webkitvisibilitychange', |
125 remoting.onVisibilityChanged, false); | 125 remoting.onVisibilityChanged, false); |
126 } else { | 126 } else { |
127 document.addEventListener('keydown', remoting.ConnectionStats.onKeydown, | 127 document.addEventListener('keydown', remoting.ConnectionStats.onKeydown, |
128 false); | 128 false); |
129 document.removeEventListener('webkitvisibilitychange', | 129 document.removeEventListener('webkitvisibilitychange', |
130 remoting.onVisibilityChanged, false); | 130 remoting.onVisibilityChanged, false); |
| 131 // TODO(jamiewalch): crbug.com/252796: Remove this once crbug.com/240772 |
| 132 // is fixed. |
| 133 document.body.parentNode.classList.remove('no-scroll'); |
131 } | 134 } |
132 }; | 135 }; |
133 | 136 |
134 /** | 137 /** |
135 * Get the major mode that the app is running in. | 138 * Get the major mode that the app is running in. |
136 * @return {string} The app's current major mode. | 139 * @return {string} The app's current major mode. |
137 */ | 140 */ |
138 remoting.getMajorMode = function() { | 141 remoting.getMajorMode = function() { |
139 return remoting.currentMode.split('.')[0]; | 142 return remoting.currentMode.split('.')[0]; |
140 }; | 143 }; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 break; | 256 break; |
254 } | 257 } |
255 } | 258 } |
256 if (removeFromKeyboardNavigation) { | 259 if (removeFromKeyboardNavigation) { |
257 element.setAttribute(kSavedAttributeName, element.tabIndex); | 260 element.setAttribute(kSavedAttributeName, element.tabIndex); |
258 element.tabIndex = -1; | 261 element.tabIndex = -1; |
259 } | 262 } |
260 } | 263 } |
261 } | 264 } |
262 } | 265 } |
OLD | NEW |