Commit c6caa3ae authored by ivankr@chromium.org's avatar ivankr@chromium.org

[cros] Fix error message screen hiding when not animated.

BUG=142459

Review URL: https://chromiumcodereview.appspot.com/10827398

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152077 0039d316-1c4b-4281-b951-d872f2087c98
parent d2885ba0
...@@ -144,10 +144,10 @@ cr.define('login', function() { ...@@ -144,10 +144,10 @@ cr.define('login', function() {
/** /**
* Shows or hides offline message based on network on/offline state. * Shows or hides offline message based on network on/offline state.
* @param {Integer} state Current state of the network (see NET_STATE). * @param {number} state Current state of the network (see NET_STATE).
* @param {string} network Name of the current network. * @param {string} network Name of the current network.
* @param {string} reason Reason the callback was called. * @param {string} reason Reason the callback was called.
* @param {int} lastNetworkType Last active network type. * @param {number} lastNetworkType Last active network type.
*/ */
updateState_: function(state, network, reason, lastNetworkType) { updateState_: function(state, network, reason, lastNetworkType) {
var currentScreen = Oobe.getInstance().currentScreen; var currentScreen = Oobe.getInstance().currentScreen;
...@@ -260,12 +260,16 @@ cr.define('login', function() { ...@@ -260,12 +260,16 @@ cr.define('login', function() {
offlineMessage.onBeforeHide(); offlineMessage.onBeforeHide();
offlineMessage.classList.add('faded'); offlineMessage.classList.add('faded');
offlineMessage.addEventListener('webkitTransitionEnd', if (offlineMessage.classList.contains('animated')) {
function f(e) { offlineMessage.addEventListener('webkitTransitionEnd',
offlineMessage.removeEventListener('webkitTransitionEnd', f); function f(e) {
if (offlineMessage.classList.contains('faded')) offlineMessage.removeEventListener('webkitTransitionEnd', f);
offlineMessage.classList.add('hidden'); if (offlineMessage.classList.contains('faded'))
}); offlineMessage.classList.add('hidden');
});
} else {
offlineMessage.classList.add('hidden');
}
currentScreen.classList.remove('hidden'); currentScreen.classList.remove('hidden');
currentScreen.classList.remove('faded'); currentScreen.classList.remove('faded');
...@@ -293,10 +297,10 @@ cr.define('login', function() { ...@@ -293,10 +297,10 @@ cr.define('login', function() {
/** /**
* Network state changed callback. * Network state changed callback.
* @param {Integer} state Current state of the network (see NET_STATE). * @param {number} state Current state of the network (see NET_STATE).
* @param {string} network Name of the current network. * @param {string} network Name of the current network.
* @param {string} reason Reason the callback was called. * @param {string} reason Reason the callback was called.
* @param {int} lastNetworkType Last active network type. * @param {number} lastNetworkType Last active network type.
*/ */
ErrorMessageScreen.updateState = function( ErrorMessageScreen.updateState = function(
state, network, reason, lastNetworkType) { state, network, reason, lastNetworkType) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment