OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 Locally managed user creation flow screen. | 6 * @fileoverview Locally managed user creation flow screen. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('login', function() { | 9 cr.define('login', function() { |
10 | 10 |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 459 |
460 this.setButtonDisabledStatus('next', true); | 460 this.setButtonDisabledStatus('next', true); |
461 }, | 461 }, |
462 | 462 |
463 /** | 463 /** |
464 * True if user name error should be displayed. | 464 * True if user name error should be displayed. |
465 * @type {boolean} | 465 * @type {boolean} |
466 */ | 466 */ |
467 set nameErrorVisible(value) { | 467 set nameErrorVisible(value) { |
468 $('managed-user-creation-flow-name-error'). | 468 $('managed-user-creation-flow-name-error'). |
469 classList[value ? 'add' : 'remove']('error'); | 469 classList.toggle('error', value); |
470 $('managed-user-creation-flow-name'). | 470 $('managed-user-creation-flow-name'). |
471 classList[value ? 'add' : 'remove']('duplicate-name'); | 471 classList.toggle('duplicate-name', value); |
472 if (!value) | 472 if (!value) |
473 $('managed-user-creation-flow-name-error').textContent = ''; | 473 $('managed-user-creation-flow-name-error').textContent = ''; |
474 }, | 474 }, |
475 | 475 |
476 /** | 476 /** |
477 * True if user name error should be displayed. | 477 * True if user name error should be displayed. |
478 * @type {boolean} | 478 * @type {boolean} |
479 */ | 479 */ |
480 set passwordErrorVisible(value) { | 480 set passwordErrorVisible(value) { |
481 $('managed-user-creation-flow-password-error'). | 481 $('managed-user-creation-flow-password-error'). |
482 classList[value ? 'add' : 'remove']('error'); | 482 classList.toggle('error', value); |
483 if (!value) | 483 if (!value) |
484 $('managed-user-creation-flow-password-error').textContent = ''; | 484 $('managed-user-creation-flow-password-error').textContent = ''; |
485 }, | 485 }, |
486 | 486 |
487 /** | 487 /** |
488 * Updates state of Continue button after minimal checks. | 488 * Updates state of Continue button after minimal checks. |
489 * @return {boolean} true, if form seems to be valid. | 489 * @return {boolean} true, if form seems to be valid. |
490 * @private | 490 * @private |
491 */ | 491 */ |
492 updateNextButtonForManager_: function() { | 492 updateNextButtonForManager_: function() { |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 | 788 |
789 LocallyManagedUserCreationScreen.loadManagers = function(userList) { | 789 LocallyManagedUserCreationScreen.loadManagers = function(userList) { |
790 var screen = $('managed-user-creation-flow'); | 790 var screen = $('managed-user-creation-flow'); |
791 screen.loadManagers(userList); | 791 screen.loadManagers(userList); |
792 }; | 792 }; |
793 | 793 |
794 return { | 794 return { |
795 LocallyManagedUserCreationScreen: LocallyManagedUserCreationScreen | 795 LocallyManagedUserCreationScreen: LocallyManagedUserCreationScreen |
796 }; | 796 }; |
797 }); | 797 }); |
OLD | NEW |