// Whether this screen is shown for the first time.
firstShown_: true,
+ // Whether this screen is currently being shown.
+ showing_: false,
+
/** @override */
decorate: function() {
login.PodRow.decorate($('pod-row'));
/** @override */
onWindowResize: function() {
$('pod-row').onWindowResize();
+
+ // Reposition the error bubble, if it is showing. Since we are just
+ // moving the bubble, the number of login attempts tried doesn't matter.
+ var errorBubble = $('bubble');
+ if (errorBubble && !errorBubble.hidden)
+ this.showErrorBubble(0, undefined /* Reuses the existing message. */);
},
/**
* @param {string} data Screen init payload.
*/
onBeforeShow: function(data) {
+ this.showing_ = true;
chrome.send('loginUIStateChanged', ['account-picker', true]);
$('login-header-bar').signinUIState = SIGNIN_UI_STATE.ACCOUNT_PICKER;
chrome.send('hideCaptivePortal');
* Event handler invoked when the page is shown and ready.
*/
onShow: function() {
+ if (!this.showing_) {
+ // This method may be called asynchronously when the pod row finishes
+ // initializing. However, at that point, the screen may have been hidden
+ // again already. If that happens, ignore the onShow() call.
+ return;
+ }
chrome.send('getTouchViewState');
if (!this.firstShown_) return;
this.firstShown_ = false;
* Event handler that is invoked just before the frame is hidden.
*/
onBeforeHide: function() {
+ this.showing_ = false;
chrome.send('loginUIStateChanged', ['account-picker', false]);
$('login-header-bar').signinUIState = SIGNIN_UI_STATE.HIDDEN;
$('pod-row').handleHide();
}
};
});
-