Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1652)

Unified Diff: chrome/browser/resources/chromeos/login/network_dropdown.js

Issue 8662005: [cros,login] Prevent WebUI race, when network drop-down is hided. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/login/network_dropdown.js
diff --git a/chrome/browser/resources/chromeos/login/network_dropdown.js b/chrome/browser/resources/chromeos/login/network_dropdown.js
index de222c735f8f12baee6087a2bcfc886f216ca877..4a07368cf92e9b984f1e3e6383f44893496303e6 100644
--- a/chrome/browser/resources/chromeos/login/network_dropdown.js
+++ b/chrome/browser/resources/chromeos/login/network_dropdown.js
@@ -354,8 +354,8 @@ cr.define('cr.ui', function() {
* @param {!Object} data Networks list.
*/
DropDown.updateNetworks = function(data) {
- var elementId = DropDown.activeElementId_;
- $(elementId).setItems(data);
+ if (DropDown.activeElementId_)
+ $(DropDown.activeElementId_).setItems(data);
};
/**
@@ -364,8 +364,8 @@ cr.define('cr.ui', function() {
* @param {!Object} icon Icon to be displayed.
*/
DropDown.updateNetworkTitle = function(title, icon) {
- var elementId = DropDown.activeElementId_;
- $(elementId).setTitle(title, icon);
+ if (DropDown.activeElementId_)
+ $(DropDown.activeElementId_).setTitle(title, icon);
};
/**
@@ -378,9 +378,11 @@ cr.define('cr.ui', function() {
*/
DropDown.setActive = function(elementId, isActive, isOobe) {
if (isActive) {
- DropDown.activeElementId_ = elementId;
$(elementId).isShown = false;
- chrome.send('networkDropdownShow', [elementId, isOobe]);
+ if (DropDown.activeElementId_ != elementId) {
+ DropDown.activeElementId_ = elementId;
+ chrome.send('networkDropdownShow', [elementId, isOobe]);
+ }
} else {
if (DropDown.activeElementId_ == elementId) {
DropDown.activeElementId_ = '';
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698