Update broken references to image assets
[chromium-blink-merge.git] / chrome / browser / resources / chromeos / login / gaia_password_changed.js
blob033ca4bafdfac29f754f6ca1333fbf7fa425ecb6
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.
5 Polymer({
6 is: 'gaia-password-changed',
8 properties: {
9 email: String,
11 disabled: {
12 type: Boolean,
13 value: false
17 ready: function() {
18 /**
19 * Workaround for
20 * https://github.com/PolymerElements/neon-animation/issues/32
21 * TODO(dzhioev): Remove when fixed in Polymer.
23 var pages = this.$.animatedPages;
24 delete pages._squelchNextFinishEvent;
25 Object.defineProperty(pages, '_squelchNextFinishEvent',
26 { get: function() { return false; } });
29 invalidate: function() {
30 this.$.oldPasswordInput.isInvalid = true;
33 reset: function() {
34 this.$.animatedPages.selected = 0;
35 this.clearPassword();
36 this.$.oldPasswordInput.isInvalid = false;
37 this.disabled = false;
38 this.$.closeButton.hidden = false;
39 this.$.oldPasswordCard.classList.remove('disabled');
43 focus: function() {
44 if (this.$.animatedPages.selected == 0)
45 this.$.oldPasswordInput.focus();
48 onPasswordSubmitted_: function() {
49 if (!this.$.oldPasswordInput.checkValidity())
50 return;
51 this.$.oldPasswordCard.classList.add('disabled');
52 this.disabled = true;
53 this.fire('passwordEnter', {password: this.$.oldPasswordInput.value});
56 onForgotPasswordClicked_: function() {
57 this.clearPassword();
58 this.$.animatedPages.selected += 1;
61 onTryAgainClicked_: function() {
62 this.$.oldPasswordInput.isInvalid = false;
63 this.$.animatedPages.selected -= 1;
66 onAnimationFinish_: function() {
67 this.focus();
70 clearPassword: function() {
71 this.$.oldPasswordInput.value = '';
74 onProceedClicked_: function() {
75 this.disabled = true;
76 this.$.closeButton.hidden = true;
77 this.$.animatedPages.selected = 2;
78 this.fire('proceedAnyway');
81 onClose_: function() {
82 this.fire('cancel');
84 });