Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 Polymer((function() { | 5 Polymer((function() { |
| 6 var DEFAULT_EMAIL_DOMAIN = '@gmail.com'; | 6 var DEFAULT_EMAIL_DOMAIN = '@gmail.com'; |
| 7 | 7 |
| 8 var TRANSITION_TYPE = { | 8 var TRANSITION_TYPE = { |
| 9 FORWARD: 0, | 9 FORWARD: 0, |
| 10 BACKWARD: 1, | 10 BACKWARD: 1, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 }, | 96 }, |
| 97 | 97 |
| 98 isRTL_: function() { | 98 isRTL_: function() { |
| 99 return !!document.querySelector('html[dir=rtl]'); | 99 return !!document.querySelector('html[dir=rtl]'); |
| 100 }, | 100 }, |
| 101 | 101 |
| 102 isEmailSectionActive_: function() { | 102 isEmailSectionActive_: function() { |
| 103 return this.$.animatedPages.selected == 'emailSection'; | 103 return this.$.animatedPages.selected == 'emailSection'; |
| 104 }, | 104 }, |
| 105 | 105 |
| 106 switchToEmailCard(animated) { | 106 switchToEmailCard: function(animated) { |
|
dpapad
2017/01/20 22:48:32
@param?
stevenjb
2017/01/20 23:05:45
None of the methods in this file (which I am not a
| |
| 107 this.$.passwordInput.value = ''; | 107 this.$.passwordInput.value = ''; |
| 108 this.$.passwordInput.isInvalid = false; | 108 this.$.passwordInput.isInvalid = false; |
| 109 this.$.emailInput.isInvalid = false; | 109 this.$.emailInput.isInvalid = false; |
| 110 if (this.isEmailSectionActive_()) | 110 if (this.isEmailSectionActive_()) |
| 111 return; | 111 return; |
| 112 this.setUpPageTransitions_( | 112 this.setUpPageTransitions_( |
| 113 animated ? TRANSITION_TYPE.BACKWARD : TRANSITION_TYPE.NONE); | 113 animated ? TRANSITION_TYPE.BACKWARD : TRANSITION_TYPE.NONE); |
| 114 this.$.animatedPages.selected = 'emailSection'; | 114 this.$.animatedPages.selected = 'emailSection'; |
| 115 }, | 115 }, |
| 116 | 116 |
| 117 switchToPasswordCard(email, animated) { | 117 switchToPasswordCard: function(email, animated) { |
|
dpapad
2017/01/20 22:48:32
Same here.
stevenjb
2017/01/20 23:05:45
ditto
| |
| 118 this.$.emailInput.value = email; | 118 this.$.emailInput.value = email; |
| 119 if (email.indexOf('@') === -1) { | 119 if (email.indexOf('@') === -1) { |
| 120 if (this.emailDomain) | 120 if (this.emailDomain) |
| 121 email = email + this.emailDomain; | 121 email = email + this.emailDomain; |
| 122 else | 122 else |
| 123 email = email + DEFAULT_EMAIL_DOMAIN; | 123 email = email + DEFAULT_EMAIL_DOMAIN; |
| 124 } | 124 } |
| 125 this.$.passwordHeader.email = email; | 125 this.$.passwordHeader.email = email; |
| 126 if (!this.isEmailSectionActive_()) | 126 if (!this.isEmailSectionActive_()) |
| 127 return; | 127 return; |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 158 var isForward = transitionType === TRANSITION_TYPE.FORWARD; | 158 var isForward = transitionType === TRANSITION_TYPE.FORWARD; |
| 159 var isRTL = this.isRTL_(); | 159 var isRTL = this.isRTL_(); |
| 160 this.$.animatedPages.entryAnimation = | 160 this.$.animatedPages.entryAnimation = |
| 161 'slide-from-' + (isForward === isRTL ? 'left' : 'right') + | 161 'slide-from-' + (isForward === isRTL ? 'left' : 'right') + |
| 162 '-animation'; | 162 '-animation'; |
| 163 this.$.animatedPages.exitAnimation = | 163 this.$.animatedPages.exitAnimation = |
| 164 'slide-' + (isForward === isRTL ? 'right' : 'left') + '-animation'; | 164 'slide-' + (isForward === isRTL ? 'right' : 'left') + '-animation'; |
| 165 } | 165 } |
| 166 }; | 166 }; |
| 167 })()); | 167 })()); |
| OLD | NEW |