OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 /** | |
6 * @fileoverview Polymer element for Active Directory password change screen. | |
7 */ | |
8 | |
michaelpg
2017/01/11 22:09:11
nit: remove blank line
Roman Sorokin (ftl)
2017/01/12 12:38:50
Done.
| |
9 Polymer({ | |
10 is: 'active-directory-password-change', | |
11 | |
12 properties: { | |
13 /** | |
14 * The user principal name. | |
15 */ | |
16 username: { | |
17 type: String, | |
18 observer: 'usernameChanged_' | |
19 }, | |
20 }, | |
21 | |
22 /** @public */ | |
23 reset: function() { | |
24 this.$.animatedPages.selected = 0; | |
25 this.$.oldPassword.value = ''; | |
26 this.$.newPassword1.value = ''; | |
27 this.$.newPassword2.value = ''; | |
28 this.updateNavigation_(); | |
29 }, | |
30 | |
31 /** @private */ | |
32 usernameChanged_: function() { | |
33 this.$.welcomeMessage.innerText = | |
michaelpg
2017/01/11 22:09:13
this would be simpler as a computed binding that r
Roman Sorokin (ftl)
2017/01/12 12:38:50
Done.
| |
34 loadTimeData.getStringF('adPasswordChangeMessage', this.username); | |
35 }, | |
36 | |
37 /** @private */ | |
38 onSubmit_: function() { | |
39 if (!this.$.oldPassword.checkValidity() || | |
40 !this.$.newPassword1.checkValidity()) { | |
41 return; | |
42 } | |
43 if (this.$.newPassword1.value != this.$.newPassword2.value) { | |
44 this.$.newPassword2.isInvalid = true; | |
45 return; | |
46 } | |
47 this.$.animatedPages.selected += 1; | |
michaelpg
2017/01/11 22:09:12
nit: use ++
Roman Sorokin (ftl)
2017/01/12 12:38:50
Done.
| |
48 this.updateNavigation_(); | |
49 var msg = { | |
50 'username': this.username, | |
51 'oldPassword': this.$.oldPassword.value, | |
52 'newPassword': this.$.newPassword1.value, | |
53 'repeatNewPassword': this.$.newPassword2.value, | |
michaelpg
2017/01/11 22:09:12
redundant
Roman Sorokin (ftl)
2017/01/12 12:38:50
Done.
| |
54 }; | |
55 this.$.oldPassword.value = ''; | |
56 this.$.newPassword1.value = ''; | |
57 this.$.newPassword2.value = ''; | |
58 this.fire('authCompleted', msg); | |
59 }, | |
60 | |
61 /** @private */ | |
62 onClose_: function() { | |
63 if (!this.$.navigation.closeVisible) | |
64 return; | |
65 this.fire('cancel'); | |
66 }, | |
67 | |
68 /** @private */ | |
69 updateNavigation_: function() { | |
70 this.$.navigation.closeVisible = (this.$.animatedPages.selected == 0); | |
71 }, | |
72 }); | |
OLD | NEW |