Chromium Code Reviews| Index: chrome/browser/resources/chromeos/login/lock.js |
| diff --git a/chrome/browser/resources/chromeos/login/lock.js b/chrome/browser/resources/chromeos/login/lock.js |
| index c1147ef2121f47d0d16ee7cb063a2b1722b1f506..ecf233ce60fa35b205a2c887c3b9a144c80e2007 100644 |
| --- a/chrome/browser/resources/chromeos/login/lock.js |
| +++ b/chrome/browser/resources/chromeos/login/lock.js |
| @@ -17,10 +17,52 @@ |
| id: 'custom-elements', |
| html: [{ url: 'chrome://oobe/custom_elements.html' }] |
| }); |
| +// TODO(sammiequon): Remove this method once showPinContainerUser works. |
|
jdufault
2016/06/15 22:20:39
nit: indent
nit: newline before the comment
nit: P
sammiequon
2016/06/17 01:00:43
Done.
|
| + var showPinContainer = function(visible) { |
| + var authContainer = document.getElementsByClassName('auth-container')[0]; |
| + var pinContainer = $('pin-container'); |
| + var signIn = document.getElementsByClassName('signed-in-indicator')[0]; |
| + var pod = document.getElementsByClassName('pod')[0]; |
| + var userImage = document.getElementsByClassName('user-image')[0]; |
| + var elems = [authContainer, pinContainer, signIn, pod, userImage]; |
| + |
| + for (var idx = 0; idx < elems.length; idx++) { |
| + var currElem = elems[idx]; |
|
jdufault
2016/06/15 22:20:38
Typically we don't abbreviate, so either currentEl
sammiequon
2016/06/17 01:00:43
Done.
|
| + if (visible) { |
| + currElem.classList.add('pin-enabled'); |
| + currElem.classList.remove('pin-disabled'); |
| + } |
| + else { |
| + currElem.classList.add('pin-disabled'); |
|
jdufault
2016/06/15 22:20:39
flip-flop the order here so pin-enabled is always
sammiequon
2016/06/17 01:00:43
Done.
|
| + currElem.classList.remove('pin-enabled'); |
| + } |
| + } |
| + }; |
| + |
| + var showPinContainer = function(visible, userPod) { |
|
jdufault
2016/06/15 22:20:38
Only one of these definitions should be committed.
|
| + var authContainer = userPod.authElement; |
| + var pinContainer = userPod.pinKeyboard; |
| + var signIn = userPod.signInElement; |
| + var pod = userPod; |
| + var userImage = userPod.imageElement; |
|
jdufault
2016/06/15 22:20:39
I don't think the local variables give us much in
sammiequon
2016/06/17 01:00:43
Done.
|
| + var elems = [authContainer, pinContainer, signIn, pod, userImage]; |
| + |
| + for (var idx = 0; idx < elems.length; idx++) { |
| + var currElem = elems[idx]; |
| + if (visible) { |
| + currElem.classList.add('pin-enabled'); |
| + currElem.classList.remove('pin-disabled'); |
| + } |
| + else { |
| + currElem.classList.add('pin-disabled'); |
| + currElem.classList.remove('pin-enabled'); |
| + } |
| + } |
| + }; |
| // Called after polymer has been loaded. Fades the pin element in. |
| var onPinLoaded = function(pinContainer) { |
| - pinContainer.style.opacity = 1; |
| + showPinContainer(true); |
| }; |
| // We only load the PIN element when it is actually shown so that lock screen |