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

Side by Side Diff: chrome/browser/resources/settings/languages_page/languages_page.js

Issue 2946563002: Run clang-format on .js files in c/b/r/settings (Closed)
Patch Set: dschuyler@ review Created 3 years, 6 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 'settings-languages-page' is the settings page 6 * @fileoverview 'settings-languages-page' is the settings page
7 * for language and input method settings. 7 * for language and input method settings.
8 */ 8 */
9 cr.exportPath('settings'); 9 cr.exportPath('settings');
10 10
(...skipping 24 matching lines...) Expand all
35 * @type {!LanguagesModel|undefined} 35 * @type {!LanguagesModel|undefined}
36 */ 36 */
37 languages: { 37 languages: {
38 type: Object, 38 type: Object,
39 notify: true, 39 notify: true,
40 }, 40 },
41 41
42 /** @type {!LanguageHelper} */ 42 /** @type {!LanguageHelper} */
43 languageHelper: Object, 43 languageHelper: Object,
44 44
45 // <if expr="not is_macosx"> 45 // <if expr="not is_macosx">
46 /** @private */ 46 /** @private */
47 spellCheckSecondaryText_: { 47 spellCheckSecondaryText_: {
48 type: String, 48 type: String,
49 value: '', 49 value: '',
50 computed: 'getSpellCheckSecondaryText_(languages.enabled.*)', 50 computed: 'getSpellCheckSecondaryText_(languages.enabled.*)',
51 }, 51 },
52 // </if> 52 // </if>
53 53
54 /** 54 /**
55 * The language to display the details for. 55 * The language to display the details for.
56 * @type {!LanguageState|undefined} 56 * @type {!LanguageState|undefined}
57 * @private 57 * @private
58 */ 58 */
59 detailLanguage_: Object, 59 detailLanguage_: Object,
60 60
61 /** @private */ 61 /** @private */
62 showAddLanguagesDialog_: Boolean, 62 showAddLanguagesDialog_: Boolean,
63 63
64 /** @private {!Map<string, string>} */ 64 /** @private {!Map<string, string>} */
65 focusConfig_: { 65 focusConfig_: {
66 type: Object, 66 type: Object,
67 value: function() { 67 value: function() {
68 var map = new Map(); 68 var map = new Map();
69 // <if expr="not is_macosx"> 69 // <if expr="not is_macosx">
70 map.set( 70 map.set(
71 settings.Route.EDIT_DICTIONARY.path, 71 settings.Route.EDIT_DICTIONARY.path,
72 '#spellCheckCollapse .subpage-arrow'); 72 '#spellCheckCollapse .subpage-arrow');
73 // </if> 73 // </if>
74 // <if expr="chromeos"> 74 // <if expr="chromeos">
75 map.set( 75 map.set(
76 settings.Route.INPUT_METHODS.path, 76 settings.Route.INPUT_METHODS.path,
77 '#inputMethodsCollapse .subpage-arrow'); 77 '#inputMethodsCollapse .subpage-arrow');
78 // </if> 78 // </if>
79 return map; 79 return map;
80 }, 80 },
81 }, 81 },
82 }, 82 },
83 83
84 /** 84 /**
85 * Stamps and opens the Add Languages dialog, registering a listener to 85 * Stamps and opens the Add Languages dialog, registering a listener to
86 * disable the dialog's dom-if again on close. 86 * disable the dialog's dom-if again on close.
87 * @param {!Event} e 87 * @param {!Event} e
88 * @private 88 * @private
(...skipping 27 matching lines...) Expand all
116 /** 116 /**
117 * @param {!LanguageState} language 117 * @param {!LanguageState} language
118 * @return {boolean} True if the "Move to top" option for |language| should be 118 * @return {boolean} True if the "Move to top" option for |language| should be
119 * visible. 119 * visible.
120 * @private 120 * @private
121 */ 121 */
122 showMoveUp_: function(language) { 122 showMoveUp_: function(language) {
123 // "Move up" is a no-op for the top language, and redundant with 123 // "Move up" is a no-op for the top language, and redundant with
124 // "Move to top" for the 2nd language. 124 // "Move to top" for the 2nd language.
125 return !this.isNthLanguage_(0, language) && 125 return !this.isNthLanguage_(0, language) &&
126 !this.isNthLanguage_(1, language); 126 !this.isNthLanguage_(1, language);
127 }, 127 },
128 128
129 /** 129 /**
130 * @param {!LanguageState} language 130 * @param {!LanguageState} language
131 * @return {boolean} True if the "Move down" option for |language| should be 131 * @return {boolean} True if the "Move down" option for |language| should be
132 * visible. 132 * visible.
133 * @private 133 * @private
134 */ 134 */
135 showMoveDown_: function(language) { 135 showMoveDown_: function(language) {
136 return !this.isNthLanguage_(this.languages.enabled.length - 1, language); 136 return !this.isNthLanguage_(this.languages.enabled.length - 1, language);
137 }, 137 },
138 138
139 /** 139 /**
140 * @param {!Object} change Polymer change object for languages.enabled.*. 140 * @param {!Object} change Polymer change object for languages.enabled.*.
141 * @return {boolean} True if there are less than 2 languages. 141 * @return {boolean} True if there are less than 2 languages.
142 */ 142 */
143 isHelpTextHidden_: function(change) { 143 isHelpTextHidden_: function(change) {
144 return this.languages.enabled.length <= 1; 144 return this.languages.enabled.length <= 1;
145 }, 145 },
146 146
147 // <if expr="chromeos"> 147 // <if expr="chromeos">
148 /** 148 /**
149 * Applies Chrome OS session tweaks to the menu. 149 * Applies Chrome OS session tweaks to the menu.
150 * @param {!CrActionMenuElement} menu 150 * @param {!CrActionMenuElement} menu
151 * @private 151 * @private
152 */ 152 */
153 tweakMenuForCrOS_: function(menu) { 153 tweakMenuForCrOS_: function(menu) {
154 // In a CrOS multi-user session, the primary user controls the UI language. 154 // In a CrOS multi-user session, the primary user controls the UI language.
155 // TODO(michaelpg): The language selection should not be hidden, but should 155 // TODO(michaelpg): The language selection should not be hidden, but should
156 // show a policy indicator. crbug.com/648498 156 // show a policy indicator. crbug.com/648498
157 if (this.isSecondaryUser_()) 157 if (this.isSecondaryUser_())
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 /** 196 /**
197 * Opens the input method extension's options page in a new tab (or focuses 197 * Opens the input method extension's options page in a new tab (or focuses
198 * an existing instance of the IME's options). 198 * an existing instance of the IME's options).
199 * @param {!{model: !{item: chrome.languageSettingsPrivate.InputMethod}}} e 199 * @param {!{model: !{item: chrome.languageSettingsPrivate.InputMethod}}} e
200 * @private 200 * @private
201 */ 201 */
202 onInputMethodOptionsTap_: function(e) { 202 onInputMethodOptionsTap_: function(e) {
203 this.languageHelper.openInputMethodOptions(e.model.item.id); 203 this.languageHelper.openInputMethodOptions(e.model.item.id);
204 }, 204 },
205 // </if> 205 // </if>
206 206
207 // <if expr="chromeos or is_win"> 207 // <if expr="chromeos or is_win">
208 /** 208 /**
209 * @return {boolean} True for a secondary user in a multi-profile session. 209 * @return {boolean} True for a secondary user in a multi-profile session.
210 * @private 210 * @private
211 */ 211 */
212 isSecondaryUser_: function() { 212 isSecondaryUser_: function() {
213 return cr.isChromeOS && loadTimeData.getBoolean('isSecondaryUser'); 213 return cr.isChromeOS && loadTimeData.getBoolean('isSecondaryUser');
214 }, 214 },
215 215
216 /** 216 /**
217 * @param {string} languageCode The language code identifying a language. 217 * @param {string} languageCode The language code identifying a language.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 */ 257 */
258 onUILanguageChange_: function(e) { 258 onUILanguageChange_: function(e) {
259 // We don't support unchecking this checkbox. TODO(michaelpg): Ask for a 259 // We don't support unchecking this checkbox. TODO(michaelpg): Ask for a
260 // simpler widget. 260 // simpler widget.
261 assert(e.target.checked); 261 assert(e.target.checked);
262 this.languageHelper.setProspectiveUILanguage( 262 this.languageHelper.setProspectiveUILanguage(
263 this.detailLanguage_.language.code); 263 this.detailLanguage_.language.code);
264 264
265 this.closeMenuSoon_(); 265 this.closeMenuSoon_();
266 }, 266 },
267 // </if> 267 // </if>
268 268
269 /** 269 /**
270 * @param {!chrome.languageSettingsPrivate.Language} language 270 * @param {!chrome.languageSettingsPrivate.Language} language
271 * @param {string} targetLanguageCode The default translate target language. 271 * @param {string} targetLanguageCode The default translate target language.
272 * @return {boolean} True if the translate checkbox should be disabled. 272 * @return {boolean} True if the translate checkbox should be disabled.
273 * @private 273 * @private
274 */ 274 */
275 disableTranslateCheckbox_: function(language, targetLanguageCode) { 275 disableTranslateCheckbox_: function(language, targetLanguageCode) {
276 if (!language.supportsTranslate) 276 if (!language.supportsTranslate)
277 return true; 277 return true;
(...skipping 28 matching lines...) Expand all
306 if (translateEnabled || cr.isChromeOS || cr.isWindows) 306 if (translateEnabled || cr.isChromeOS || cr.isWindows)
307 return 'complex'; 307 return 'complex';
308 return ''; 308 return '';
309 }, 309 },
310 310
311 /** 311 /**
312 * Moves the language to the top of the list. 312 * Moves the language to the top of the list.
313 * @private 313 * @private
314 */ 314 */
315 onMoveToTopTap_: function() { 315 onMoveToTopTap_: function() {
316 /** @type {!CrActionMenuElement} */(this.$.menu.get()).close(); 316 /** @type {!CrActionMenuElement} */ (this.$.menu.get()).close();
317 this.languageHelper.moveLanguageToFront(this.detailLanguage_.language.code); 317 this.languageHelper.moveLanguageToFront(this.detailLanguage_.language.code);
318 }, 318 },
319 319
320 /** 320 /**
321 * Moves the language up in the list. 321 * Moves the language up in the list.
322 * @private 322 * @private
323 */ 323 */
324 onMoveUpTap_: function() { 324 onMoveUpTap_: function() {
325 /** @type {!CrActionMenuElement} */(this.$.menu.get()).close(); 325 /** @type {!CrActionMenuElement} */ (this.$.menu.get()).close();
326 this.languageHelper.moveLanguage(this.detailLanguage_.language.code, -1); 326 this.languageHelper.moveLanguage(this.detailLanguage_.language.code, -1);
327 }, 327 },
328 328
329 /** 329 /**
330 * Moves the language down in the list. 330 * Moves the language down in the list.
331 * @private 331 * @private
332 */ 332 */
333 onMoveDownTap_: function() { 333 onMoveDownTap_: function() {
334 /** @type {!CrActionMenuElement} */(this.$.menu.get()).close(); 334 /** @type {!CrActionMenuElement} */ (this.$.menu.get()).close();
335 this.languageHelper.moveLanguage(this.detailLanguage_.language.code, 1); 335 this.languageHelper.moveLanguage(this.detailLanguage_.language.code, 1);
336 }, 336 },
337 337
338 /** 338 /**
339 * Disables the language. 339 * Disables the language.
340 * @private 340 * @private
341 */ 341 */
342 onRemoveLanguageTap_: function() { 342 onRemoveLanguageTap_: function() {
343 /** @type {!CrActionMenuElement} */(this.$.menu.get()).close(); 343 /** @type {!CrActionMenuElement} */ (this.$.menu.get()).close();
344 this.languageHelper.disableLanguage(this.detailLanguage_.language.code); 344 this.languageHelper.disableLanguage(this.detailLanguage_.language.code);
345 }, 345 },
346 346
347 // <if expr="chromeos or is_win"> 347 // <if expr="chromeos or is_win">
348 /** 348 /**
349 * Checks whether the prospective UI language (the pref that indicates what 349 * Checks whether the prospective UI language (the pref that indicates what
350 * language to use in Chrome) matches the current language. This pref is used 350 * language to use in Chrome) matches the current language. This pref is used
351 * only on Chrome OS and Windows; we don't control the UI language elsewhere. 351 * only on Chrome OS and Windows; we don't control the UI language elsewhere.
352 * @param {string} languageCode The language code identifying a language. 352 * @param {string} languageCode The language code identifying a language.
353 * @param {string} prospectiveUILanguage The prospective UI language. 353 * @param {string} prospectiveUILanguage The prospective UI language.
354 * @return {boolean} True if the given language matches the prospective UI 354 * @return {boolean} True if the given language matches the prospective UI
355 * pref (which may be different from the actual UI language). 355 * pref (which may be different from the actual UI language).
356 * @private 356 * @private
357 */ 357 */
358 isProspectiveUILanguage_: function(languageCode, prospectiveUILanguage) { 358 isProspectiveUILanguage_: function(languageCode, prospectiveUILanguage) {
359 return languageCode == prospectiveUILanguage; 359 return languageCode == prospectiveUILanguage;
360 }, 360 },
361 361
362 /** 362 /**
363 * @param {string} prospectiveUILanguage 363 * @param {string} prospectiveUILanguage
364 * @return {string} 364 * @return {string}
365 * @private 365 * @private
366 */ 366 */
367 getProspectiveUILanguageName_: function(prospectiveUILanguage) { 367 getProspectiveUILanguageName_: function(prospectiveUILanguage) {
368 return this.languageHelper.getLanguage(prospectiveUILanguage).displayName; 368 return this.languageHelper.getLanguage(prospectiveUILanguage).displayName;
369 }, 369 },
370 // </if> 370 // </if>
371 371
372 /** 372 /**
373 * @return {string} 373 * @return {string}
374 * @private 374 * @private
375 */ 375 */
376 getLanguageListTwoLine_: function() { 376 getLanguageListTwoLine_: function() {
377 return cr.isChromeOS || cr.isWindows ? 'two-line' : ''; 377 return cr.isChromeOS || cr.isWindows ? 'two-line' : '';
378 }, 378 },
379 379
380 // <if expr="not is_macosx"> 380 // <if expr="not is_macosx">
381 /** 381 /**
382 * Returns the secondary text for the spell check subsection based on the 382 * Returns the secondary text for the spell check subsection based on the
383 * enabled spell check languages, listing at most 2 languages. 383 * enabled spell check languages, listing at most 2 languages.
384 * @return {string} 384 * @return {string}
385 * @private 385 * @private
386 */ 386 */
387 getSpellCheckSecondaryText_: function() { 387 getSpellCheckSecondaryText_: function() {
388 var enabledSpellCheckLanguages = 388 var enabledSpellCheckLanguages =
389 this.languages.enabled.filter(function(languageState) { 389 this.languages.enabled.filter(function(languageState) {
390 return languageState.spellCheckEnabled && 390 return languageState.spellCheckEnabled &&
391 languageState.language.supportsSpellcheck; 391 languageState.language.supportsSpellcheck;
392 }); 392 });
393 switch (enabledSpellCheckLanguages.length) { 393 switch (enabledSpellCheckLanguages.length) {
394 case 0: 394 case 0:
395 return ''; 395 return '';
396 case 1: 396 case 1:
397 return enabledSpellCheckLanguages[0].language.displayName; 397 return enabledSpellCheckLanguages[0].language.displayName;
398 case 2: 398 case 2:
399 return loadTimeData.getStringF( 399 return loadTimeData.getStringF(
400 'spellCheckSummaryTwoLanguages', 400 'spellCheckSummaryTwoLanguages',
401 enabledSpellCheckLanguages[0].language.displayName, 401 enabledSpellCheckLanguages[0].language.displayName,
(...skipping 24 matching lines...) Expand all
426 426
427 /** 427 /**
428 * Handler for enabling or disabling spell check. 428 * Handler for enabling or disabling spell check.
429 * @param {!{target: Element, model: !{item: !LanguageState}}} e 429 * @param {!{target: Element, model: !{item: !LanguageState}}} e
430 */ 430 */
431 onSpellCheckChange_: function(e) { 431 onSpellCheckChange_: function(e) {
432 var item = e.model.item; 432 var item = e.model.item;
433 if (!item.language.supportsSpellcheck) 433 if (!item.language.supportsSpellcheck)
434 return; 434 return;
435 435
436 this.languageHelper.toggleSpellCheck(item.language.code, 436 this.languageHelper.toggleSpellCheck(
437 !item.spellCheckEnabled); 437 item.language.code, !item.spellCheckEnabled);
438 }, 438 },
439 439
440 /** 440 /**
441 * @return {string} 441 * @return {string}
442 * @private 442 * @private
443 */ 443 */
444 getSpellCheckListTwoLine_: function() { 444 getSpellCheckListTwoLine_: function() {
445 return this.spellCheckSecondaryText_.length ? 'two-line' : ''; 445 return this.spellCheckSecondaryText_.length ? 'two-line' : '';
446 }, 446 },
447 // </if> 447 // </if>
448 448
449 /** 449 /**
450 * Returns either the "selected" class, if the language matches the 450 * Returns either the "selected" class, if the language matches the
451 * prospective UI language, or an empty string. Languages can only be 451 * prospective UI language, or an empty string. Languages can only be
452 * selected on Chrome OS and Windows. 452 * selected on Chrome OS and Windows.
453 * @param {string} languageCode The language code identifying a language. 453 * @param {string} languageCode The language code identifying a language.
454 * @param {string} prospectiveUILanguage The prospective UI language. 454 * @param {string} prospectiveUILanguage The prospective UI language.
455 * @return {string} The class name for the language item. 455 * @return {string} The class name for the language item.
456 * @private 456 * @private
457 */ 457 */
458 getLanguageItemClass_: function(languageCode, prospectiveUILanguage) { 458 getLanguageItemClass_: function(languageCode, prospectiveUILanguage) {
459 if ((cr.isChromeOS || cr.isWindows) && 459 if ((cr.isChromeOS || cr.isWindows) &&
460 languageCode == prospectiveUILanguage) { 460 languageCode == prospectiveUILanguage) {
461 return 'selected'; 461 return 'selected';
462 } 462 }
463 return ''; 463 return '';
464 }, 464 },
465 465
466 // <if expr="chromeos"> 466 // <if expr="chromeos">
467 /** 467 /**
468 * @param {string} id The input method ID. 468 * @param {string} id The input method ID.
469 * @param {string} currentId The ID of the currently enabled input method. 469 * @param {string} currentId The ID of the currently enabled input method.
470 * @return {boolean} True if the IDs match. 470 * @return {boolean} True if the IDs match.
471 * @private 471 * @private
472 */ 472 */
473 isCurrentInputMethod_: function(id, currentId) { 473 isCurrentInputMethod_: function(id, currentId) {
474 assert(cr.isChromeOS); 474 assert(cr.isChromeOS);
475 return id == currentId; 475 return id == currentId;
476 }, 476 },
477 477
478 /** 478 /**
479 * @param {string} id The input method ID. 479 * @param {string} id The input method ID.
480 * @param {string} currentId The ID of the currently enabled input method. 480 * @param {string} currentId The ID of the currently enabled input method.
481 * @return {string} The class for the input method item. 481 * @return {string} The class for the input method item.
482 * @private 482 * @private
483 */ 483 */
484 getInputMethodItemClass_: function(id, currentId) { 484 getInputMethodItemClass_: function(id, currentId) {
485 assert(cr.isChromeOS); 485 assert(cr.isChromeOS);
486 return this.isCurrentInputMethod_(id, currentId) ? 'selected' : ''; 486 return this.isCurrentInputMethod_(id, currentId) ? 'selected' : '';
487 }, 487 },
488 488
489 getInputMethodName_: function(id) { 489 getInputMethodName_: function(id) {
490 assert(cr.isChromeOS); 490 assert(cr.isChromeOS);
491 var inputMethod = this.languages.inputMethods.enabled.find( 491 var inputMethod =
492 function(inputMethod) { 492 this.languages.inputMethods.enabled.find(function(inputMethod) {
493 return inputMethod.id == id; 493 return inputMethod.id == id;
494 }); 494 });
495 return inputMethod ? inputMethod.displayName : ''; 495 return inputMethod ? inputMethod.displayName : '';
496 }, 496 },
497 // </if> 497 // </if>
498 498
499 /** 499 /**
500 * @param {!Event} e 500 * @param {!Event} e
501 * @private 501 * @private
502 */ 502 */
503 onDotsTap_: function(e) { 503 onDotsTap_: function(e) {
504 // Set a copy of the LanguageState object since it is not data-bound to the 504 // Set a copy of the LanguageState object since it is not data-bound to the
505 // languages model directly. 505 // languages model directly.
506 this.detailLanguage_ = /** @type {!LanguageState} */(Object.assign( 506 this.detailLanguage_ = /** @type {!LanguageState} */ (Object.assign(
507 {}, 507 {},
508 /** @type {!{model: !{item: !LanguageState}}} */(e).model.item)); 508 /** @type {!{model: !{item: !LanguageState}}} */ (e).model.item));
509 509
510 // Ensure the template has been stamped. 510 // Ensure the template has been stamped.
511 var menu = /** @type {?CrActionMenuElement} */( 511 var menu = /** @type {?CrActionMenuElement} */ (this.$.menu.getIfExists());
512 this.$.menu.getIfExists());
513 if (!menu) { 512 if (!menu) {
514 menu = /** @type {!CrActionMenuElement} */(this.$.menu.get()); 513 menu = /** @type {!CrActionMenuElement} */ (this.$.menu.get());
515 // <if expr="chromeos"> 514 // <if expr="chromeos">
516 this.tweakMenuForCrOS_(menu); 515 this.tweakMenuForCrOS_(menu);
517 // </if> 516 // </if>
518 } 517 }
519 518
520 menu.showAt(/** @type {!Element} */ (e.target)); 519 menu.showAt(/** @type {!Element} */ (e.target));
521 }, 520 },
522 521
523 /** 522 /**
524 * Closes the shared action menu after a short delay, so when a checkbox is 523 * Closes the shared action menu after a short delay, so when a checkbox is
525 * tapped it can be seen to change state before disappearing. 524 * tapped it can be seen to change state before disappearing.
526 * @private 525 * @private
527 */ 526 */
528 closeMenuSoon_: function() { 527 closeMenuSoon_: function() {
529 var menu = /** @type {!CrActionMenuElement} */(this.$.menu.get()); 528 var menu = /** @type {!CrActionMenuElement} */ (this.$.menu.get());
530 setTimeout(function() { 529 setTimeout(function() {
531 if (menu.open) 530 if (menu.open)
532 menu.close(); 531 menu.close();
533 }, settings.kMenuCloseDelay); 532 }, settings.kMenuCloseDelay);
534 }, 533 },
535 534
536 // <if expr="chromeos or is_win"> 535 // <if expr="chromeos or is_win">
537 /** 536 /**
538 * Handler for the restart button. 537 * Handler for the restart button.
539 * @private 538 * @private
540 */ 539 */
541 onRestartTap_: function() { 540 onRestartTap_: function() {
542 // <if expr="chromeos"> 541 // <if expr="chromeos">
543 settings.LifetimeBrowserProxyImpl.getInstance().signOutAndRestart(); 542 settings.LifetimeBrowserProxyImpl.getInstance().signOutAndRestart();
544 // </if> 543 // </if>
545 // <if expr="is_win"> 544 // <if expr="is_win">
546 settings.LifetimeBrowserProxyImpl.getInstance().restart(); 545 settings.LifetimeBrowserProxyImpl.getInstance().restart();
547 // </if> 546 // </if>
548 }, 547 },
549 // </if> 548 // </if>
550 549
551 /** 550 /**
552 * Toggles the expand button within the element being listened to. 551 * Toggles the expand button within the element being listened to.
553 * @param {!Event} e 552 * @param {!Event} e
554 * @private 553 * @private
555 */ 554 */
556 toggleExpandButton_: function(e) { 555 toggleExpandButton_: function(e) {
557 // The expand button handles toggling itself. 556 // The expand button handles toggling itself.
558 var expandButtonTag = 'CR-EXPAND-BUTTON'; 557 var expandButtonTag = 'CR-EXPAND-BUTTON';
559 if (e.target.tagName == expandButtonTag) 558 if (e.target.tagName == expandButtonTag)
560 return; 559 return;
561 560
562 /** @type {!CrExpandButtonElement} */ 561 /** @type {!CrExpandButtonElement} */
563 var expandButton = e.currentTarget.querySelector(expandButtonTag); 562 var expandButton = e.currentTarget.querySelector(expandButtonTag);
564 assert(expandButton); 563 assert(expandButton);
565 expandButton.expanded = !expandButton.expanded; 564 expandButton.expanded = !expandButton.expanded;
566 }, 565 },
567 }); 566 });
568 })(); 567 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698