| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 User pod row implementation. | 6 * @fileoverview User pod row implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 cr.define('login', function() { | 9 cr.define('login', function() { |
| 10 /** | 10 /** |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 | 366 |
| 367 /** | 367 /** |
| 368 * Gets user type bubble like multi-profiles policy restriction message. | 368 * Gets user type bubble like multi-profiles policy restriction message. |
| 369 * @type {!HTMLDivElement} | 369 * @type {!HTMLDivElement} |
| 370 */ | 370 */ |
| 371 get userTypeBubbleElement() { | 371 get userTypeBubbleElement() { |
| 372 return this.querySelector('.user-type-bubble'); | 372 return this.querySelector('.user-type-bubble'); |
| 373 }, | 373 }, |
| 374 | 374 |
| 375 /** | 375 /** |
| 376 * Gets action box menu. |
| 377 * @type {!HTMLInputElement} |
| 378 */ |
| 379 get actionBoxMenu() { |
| 380 return this.querySelector('.action-box-menu'); |
| 381 }, |
| 382 |
| 383 /** |
| 376 * Gets action box menu title, user name item. | 384 * Gets action box menu title, user name item. |
| 377 * @type {!HTMLInputElement} | 385 * @type {!HTMLInputElement} |
| 378 */ | 386 */ |
| 379 get actionBoxMenuTitleNameElement() { | 387 get actionBoxMenuTitleNameElement() { |
| 380 return this.querySelector('.action-box-menu-title-name'); | 388 return this.querySelector('.action-box-menu-title-name'); |
| 381 }, | 389 }, |
| 382 | 390 |
| 383 /** | 391 /** |
| 384 * Gets action box menu title, user email item. | 392 * Gets action box menu title, user email item. |
| 385 * @type {!HTMLInputElement} | 393 * @type {!HTMLInputElement} |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 this.parentNode.focusPod(undefined, true); | 583 this.parentNode.focusPod(undefined, true); |
| 576 this.actionBoxAreaElement.focus(); | 584 this.actionBoxAreaElement.focus(); |
| 577 } | 585 } |
| 578 | 586 |
| 579 // Hide user-type-bubble. | 587 // Hide user-type-bubble. |
| 580 this.userTypeBubbleElement.classList.remove('bubble-shown'); | 588 this.userTypeBubbleElement.classList.remove('bubble-shown'); |
| 581 | 589 |
| 582 this.actionBoxAreaElement.classList.add('active'); | 590 this.actionBoxAreaElement.classList.add('active'); |
| 583 } else { | 591 } else { |
| 584 this.actionBoxAreaElement.classList.remove('active'); | 592 this.actionBoxAreaElement.classList.remove('active'); |
| 593 this.actionBoxAreaElement.classList.remove('menuMovedUp'); |
| 594 this.actionBoxMenu.classList.remove('menuMovedUp'); |
| 585 } | 595 } |
| 586 }, | 596 }, |
| 587 | 597 |
| 588 /** | 598 /** |
| 589 * Whether action box button is in hovered state. | 599 * Whether action box button is in hovered state. |
| 590 * @type {boolean} | 600 * @type {boolean} |
| 591 */ | 601 */ |
| 592 get isActionBoxMenuHovered() { | 602 get isActionBoxMenuHovered() { |
| 593 return this.actionBoxAreaElement.classList.contains('hovered'); | 603 return this.actionBoxAreaElement.classList.contains('hovered'); |
| 594 }, | 604 }, |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 }, | 835 }, |
| 826 | 836 |
| 827 /** | 837 /** |
| 828 * Shows remove user warning. Used for supervised users on CrOS, and for all | 838 * Shows remove user warning. Used for supervised users on CrOS, and for all |
| 829 * users on desktop. | 839 * users on desktop. |
| 830 */ | 840 */ |
| 831 showRemoveWarning_: function() { | 841 showRemoveWarning_: function() { |
| 832 this.actionBoxMenuRemoveElement.hidden = true; | 842 this.actionBoxMenuRemoveElement.hidden = true; |
| 833 this.actionBoxRemoveUserWarningElement.hidden = false; | 843 this.actionBoxRemoveUserWarningElement.hidden = false; |
| 834 this.actionBoxRemoveUserWarningButtonElement.focus(); | 844 this.actionBoxRemoveUserWarningButtonElement.focus(); |
| 845 |
| 846 // Move up the menu if it overlaps shelf. |
| 847 var maxHeight = Oobe.getMaxHeightBeforeShelfOverlapping( |
| 848 this.actionBoxMenu); |
| 849 var actualHeight = parseInt( |
| 850 window.getComputedStyle(this.actionBoxMenu).height); |
| 851 if (maxHeight < actualHeight) { |
| 852 this.actionBoxMenu.classList.add('menuMovedUp'); |
| 853 this.actionBoxAreaElement.classList.add('menuMovedUp'); |
| 854 } |
| 835 }, | 855 }, |
| 836 | 856 |
| 837 /** | 857 /** |
| 838 * Handles a click event on remove user confirmation button. | 858 * Handles a click event on remove user confirmation button. |
| 839 * @param {Event} e Click event. | 859 * @param {Event} e Click event. |
| 840 */ | 860 */ |
| 841 handleRemoveUserConfirmationClick_: function(e) { | 861 handleRemoveUserConfirmationClick_: function(e) { |
| 842 if (this.isActionBoxMenuActive) { | 862 if (this.isActionBoxMenuActive) { |
| 843 this.isActionBoxMenuActive = false; | 863 this.isActionBoxMenuActive = false; |
| 844 this.removeUser(this.user); | 864 this.removeUser(this.user); |
| (...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2293 if (this.podsWithPendingImages_.length == 0) { | 2313 if (this.podsWithPendingImages_.length == 0) { |
| 2294 this.classList.remove('images-loading'); | 2314 this.classList.remove('images-loading'); |
| 2295 } | 2315 } |
| 2296 } | 2316 } |
| 2297 }; | 2317 }; |
| 2298 | 2318 |
| 2299 return { | 2319 return { |
| 2300 PodRow: PodRow | 2320 PodRow: PodRow |
| 2301 }; | 2321 }; |
| 2302 }); | 2322 }); |
| OLD | NEW |