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

Side by Side Diff: chrome/browser/resources/chromeos/login/bubble.js

Issue 14296002: Use classList#toggle instead of classList[whatever ? 'add' : 'remove']. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 7 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/login/screen_account_picker.js » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 /** 5 /**
6 * @fileoverview Bubble implementation. 6 * @fileoverview Bubble implementation.
7 */ 7 */
8 8
9 // TODO(xiyuan): Move this into shared. 9 // TODO(xiyuan): Move this into shared.
10 cr.define('cr.ui', function() { 10 cr.define('cr.ui', function() {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 e.stopPropagation(); 92 e.stopPropagation();
93 }, 93 },
94 94
95 /** 95 /**
96 * Sets the attachment of the bubble. 96 * Sets the attachment of the bubble.
97 * @param {!Attachment} attachment Bubble attachment. 97 * @param {!Attachment} attachment Bubble attachment.
98 */ 98 */
99 setAttachment_: function(attachment) { 99 setAttachment_: function(attachment) {
100 for (var k in Bubble.Attachment) { 100 for (var k in Bubble.Attachment) {
101 var v = Bubble.Attachment[k]; 101 var v = Bubble.Attachment[k];
102 this.classList[v == attachment ? 'add' : 'remove'](v); 102 this.classList.toggle(v, v == attachment);
103 } 103 }
104 }, 104 },
105 105
106 /** 106 /**
107 * Shows the bubble for given anchor element. 107 * Shows the bubble for given anchor element.
108 * @param {!Object} pos Bubble position (left, top, right, bottom in px). 108 * @param {!Object} pos Bubble position (left, top, right, bottom in px).
109 * @param {!Attachment} attachment Bubble attachment (on which side of the 109 * @param {!Attachment} attachment Bubble attachment (on which side of the
110 * specified position it should be displayed). 110 * specified position it should be displayed).
111 * @param {HTMLElement} opt_content Content to show in bubble. 111 * @param {HTMLElement} opt_content Content to show in bubble.
112 * If not specified, bubble element content is shown. 112 * If not specified, bubble element content is shown.
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 handleWindowBlur_: function(e) { 304 handleWindowBlur_: function(e) {
305 if (!this.hidden) 305 if (!this.hidden)
306 this.hide(); 306 this.hide();
307 } 307 }
308 }; 308 };
309 309
310 return { 310 return {
311 Bubble: Bubble 311 Bubble: Bubble
312 }; 312 };
313 }); 313 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/login/screen_account_picker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698