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

Side by Side Diff: chrome/browser/resources/options/chromeos_accounts_user_list.js

Issue 6380015: Fix ChromeOS users list multiple X problem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: apply kochi's fix and for his comments #1 Created 9 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/options/chromeos_accounts_options_page.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 cr.define('options.accounts', function() { 5 cr.define('options.accounts', function() {
6 const List = cr.ui.List; 6 const List = cr.ui.List;
7 const ListItem = cr.ui.ListItem; 7 const ListItem = cr.ui.ListItem;
8 const ArrayDataModel = cr.ui.ArrayDataModel; 8 const ArrayDataModel = cr.ui.ArrayDataModel;
9 9
10 /** 10 /**
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 /** 96 /**
97 * Handles the clicks on the list and triggers user removal if the click 97 * Handles the clicks on the list and triggers user removal if the click
98 * is on the remove user button. 98 * is on the remove user button.
99 * @private 99 * @private
100 * @param {!Event} e The click event object. 100 * @param {!Event} e The click event object.
101 */ 101 */
102 handleClick_: function(e) { 102 handleClick_: function(e) {
103 // Handle left button click 103 // Handle left button click
104 if (e.button == 0) { 104 if (e.button == 0) {
105 var el = e.target; 105 var el = e.target;
106 if (el.className == 'remove-user-button') { 106 if (el.classList.contains('remove-user-button')) {
107 this.removeUser(el.parentNode.user); 107 this.removeUser(el.parentNode.user);
108 } 108 }
109 } 109 }
110 }, 110 },
111 111
112 /** 112 /**
113 * Loads given user list. 113 * Loads given user list.
114 * @param {Array} users An array of user object. 114 * @param {Array} users An array of user object.
115 */ 115 */
116 load_: function(users) { 116 load_: function(users) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 var labelEmail = this.ownerDocument.createElement('span'); 166 var labelEmail = this.ownerDocument.createElement('span');
167 labelEmail.className = 'user-email-label'; 167 labelEmail.className = 'user-email-label';
168 labelEmail.textContent = this.user.email; 168 labelEmail.textContent = this.user.email;
169 169
170 var labelName = this.ownerDocument.createElement('span'); 170 var labelName = this.ownerDocument.createElement('span');
171 labelName.className = 'user-name-label'; 171 labelName.className = 'user-name-label';
172 labelName.textContent = this.user.owner ? 172 labelName.textContent = this.user.owner ?
173 localStrings.getStringF('username_format', this.user.name) : 173 localStrings.getStringF('username_format', this.user.name) :
174 this.user.name; 174 this.user.name;
175 175
176 var emailNameBlock = this.ownerDocument.createElement('div');
177 emailNameBlock.className = 'user-email-name-block';
178 emailNameBlock.appendChild(labelEmail);
179 emailNameBlock.appendChild(labelName);
180 emailNameBlock.title = this.user.owner ?
181 localStrings.getStringF('username_format', this.user.email) :
182 this.user.email;
183
176 this.appendChild(icon); 184 this.appendChild(icon);
177 this.appendChild(labelEmail); 185 this.appendChild(emailNameBlock);
178 this.appendChild(labelName);
179 186
180 if (!this.user.owner) { 187 if (!this.user.owner) {
181 var removeButton = this.ownerDocument.createElement('button'); 188 var removeButton = this.ownerDocument.createElement('button');
182 removeButton.className = 'remove-user-button'; 189 removeButton.classList.add('raw-button');
190 removeButton.classList.add('remove-user-button');
183 this.appendChild(removeButton); 191 this.appendChild(removeButton);
184 } 192 }
185 } 193 }
186 }; 194 };
187 195
188 return { 196 return {
189 UserList: UserList 197 UserList: UserList
190 }; 198 };
191 }); 199 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/chromeos_accounts_options_page.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698