OLD | NEW |
---|---|
(Empty) | |
1 /* Copyright 2015 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 Polymer('saml-confirm-password', { | |
7 onClose: function() { | |
8 this.$.cancelConfirmDlg.toggle(); | |
9 }, | |
10 | |
11 onConfirmCancel: function() { | |
12 this.fire('cancel'); | |
13 }, | |
14 | |
15 reset: function() { | |
16 this.$.cancelConfirmDlg.close(); | |
17 this.disabled = false; | |
18 this.$.closeButton.hidden = false; | |
19 this.$.animatedPages.selected = 0; | |
20 this.$.passwordInput.inputValue = ''; | |
21 }, | |
22 | |
23 invalidate: function() { | |
24 this.$.passwordInput.setValid(false); | |
25 }, | |
26 | |
27 focus: function() { | |
bartfab (slow)
2015/04/30 12:39:49
Where is this triggered?
Roman Sorokin (ftl)
2015/04/30 15:03:04
in ConfirmPasswordScreen.onAfterShow
| |
28 if (this.$.animatedPages.selected == 0) | |
29 this.$.passwordInput.focus(); | |
30 }, | |
31 | |
32 set disabled(value) { | |
33 this.$.confirmPasswordCard.classList.toggle('full-disabled', value); | |
34 this.$.passwordInput.disabled = value; | |
35 this.$.closeButton.disabled = value; | |
36 }, | |
37 | |
38 ready: function() { | |
39 this.$.cancelConfirmDlg.addEventListener('core-overlay-open-completed', | |
40 function() { | |
bartfab (slow)
2015/04/30 12:39:49
Nit: Indentation.
Roman Sorokin (ftl)
2015/04/30 15:03:04
Done.
| |
41 this.disabled = true; | |
bartfab (slow)
2015/04/30 12:39:48
Doesn't this mean that while the dialog is in the
Roman Sorokin (ftl)
2015/04/30 15:03:04
Moved to onClose
| |
42 }.bind(this)); | |
43 this.$.cancelConfirmDlg.addEventListener('core-overlay-close-completed', | |
44 function() { | |
bartfab (slow)
2015/04/30 12:39:48
Nit: Indentation.
Roman Sorokin (ftl)
2015/04/30 15:03:04
Done.
| |
45 this.disabled = false; | |
46 }.bind(this)); | |
47 this.$.passwordInput.addEventListener('buttonClick', function() { | |
48 var inputPassword = this.$.passwordInput.inputValue; | |
bartfab (slow)
2015/04/30 12:39:49
Nit: Should this block not be indented 2 spaces, n
Roman Sorokin (ftl)
2015/04/30 15:03:04
Done.
| |
49 this.$.passwordInput.inputValue = ''; | |
50 if (!inputPassword) { | |
51 this.invalidate(); | |
52 } else { | |
53 this.$.animatedPages.selected += 1; | |
54 this.$.closeButton.hidden = true; | |
55 this.fire('passwordEnter', {password: inputPassword}); | |
56 } | |
57 }.bind(this))} | |
58 }); | |
OLD | NEW |