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 Network drop-down implementation. | 6 * @fileoverview Network drop-down implementation. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('cr.ui', function() { | 9 cr.define('cr.ui', function() { |
10 /** | 10 /** |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 if ('sub' in item) { | 166 if ('sub' in item) { |
167 // Workaround for submenus, add items on top level. | 167 // Workaround for submenus, add items on top level. |
168 // TODO(altimofeev): support submenus. | 168 // TODO(altimofeev): support submenus. |
169 for (var j = 0; j < item.sub.length; ++j) | 169 for (var j = 0; j < item.sub.length; ++j) |
170 this.createItem_(this.container, item.sub[j]); | 170 this.createItem_(this.container, item.sub[j]); |
171 continue; | 171 continue; |
172 } | 172 } |
173 this.createItem_(this.container, item); | 173 this.createItem_(this.container, item); |
174 } | 174 } |
175 this.container.selectItem(this.container.firstItem, false); | 175 this.container.selectItem(this.container.firstItem, false); |
176 | |
177 var maxHeight = Oobe.getMaxHeightBeforeShelfOverlapping( | |
178 this.container); | |
179 if (maxHeight < parseInt(window.getComputedStyle(this.container).height)) | |
180 this.container.style.maxHeight = maxHeight + 'px'; | |
dzhioev (left Google)
2014/07/16 19:13:51
Are you sure that accessing to CSS properties with
merkulova
2014/07/22 08:11:44
Well... it's accessed from js like this.
| |
176 }, | 181 }, |
177 | 182 |
178 /** | 183 /** |
179 * Id of the active drop-down element. | 184 * Id of the active drop-down element. |
180 * @private | 185 * @private |
181 */ | 186 */ |
182 activeElementId_: '', | 187 activeElementId_: '', |
183 | 188 |
184 /** | 189 /** |
185 * Creates dropdown item element and adds into container. | 190 * Creates dropdown item element and adds into container. |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
429 * Sets the keyboard flow flag. | 434 * Sets the keyboard flow flag. |
430 */ | 435 */ |
431 DropDown.enableKeyboardFlow = function() { | 436 DropDown.enableKeyboardFlow = function() { |
432 useKeyboardFlow = true; | 437 useKeyboardFlow = true; |
433 }; | 438 }; |
434 | 439 |
435 return { | 440 return { |
436 DropDown: DropDown | 441 DropDown: DropDown |
437 }; | 442 }; |
438 }); | 443 }); |
OLD | NEW |