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.
6 is
: 'saml-confirm-password',
14 observer
: 'disabledChanged_'
21 * https://github.com/PolymerElements/neon-animation/issues/32
22 * TODO(dzhioev): Remove when fixed in Polymer.
24 var pages
= this.$.animatedPages
;
25 delete pages
._squelchNextFinishEvent
;
26 Object
.defineProperty(pages
, '_squelchNextFinishEvent',
27 { get: function() { return false; } });
31 this.$.cancelConfirmDlg
.close();
32 this.disabled
= false;
33 this.$.closeButton
.hidden
= false;
34 if (this.$.animatedPages
.selected
!= 0)
35 this.$.animatedPages
.selected
= 0;
36 this.$.passwordInput
.value
= '';
39 invalidate: function() {
40 this.$.passwordInput
.isInvalid
= true;
44 if (this.$.animatedPages
.selected
== 0)
45 this.$.passwordInput
.focus();
48 onClose_: function() {
50 this.$.cancelConfirmDlg
.fitInto
= this;
51 this.$.cancelConfirmDlg
.open();
54 onConfirmCancel_: function() {
58 onPasswordSubmitted_: function() {
59 if (!this.$.passwordInput
.checkValidity())
61 this.$.animatedPages
.selected
= 1;
62 this.$.closeButton
.hidden
= true;
63 this.fire('passwordEnter', {password
: this.$.passwordInput
.value
});
66 onDialogOverlayClosed_: function() {
67 this.disabled
= false;
70 disabledChanged_: function(disabled
) {
71 this.$.confirmPasswordCard
.classList
.toggle('full-disabled', disabled
);
74 onAnimationFinish_: function() {
75 if (this.$.animatedPages
.selected
== 1)
76 this.$.passwordInput
.value
= '';