| OLD | NEW |
| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 * Stamps and opens the Add Languages dialog, registering a listener to | 89 * Stamps and opens the Add Languages dialog, registering a listener to |
| 90 * disable the dialog's dom-if again on close. | 90 * disable the dialog's dom-if again on close. |
| 91 * @param {!Event} e | 91 * @param {!Event} e |
| 92 * @private | 92 * @private |
| 93 */ | 93 */ |
| 94 onAddLanguagesTap_: function(e) { | 94 onAddLanguagesTap_: function(e) { |
| 95 e.preventDefault(); | 95 e.preventDefault(); |
| 96 this.showAddLanguagesDialog_ = true; | 96 this.showAddLanguagesDialog_ = true; |
| 97 this.async(function() { | 97 this.async(function() { |
| 98 var dialog = this.$$('settings-add-languages-dialog'); | 98 var dialog = this.$$('settings-add-languages-dialog'); |
| 99 dialog.addEventListener('close', function() { | 99 dialog.addEventListener('close', () => { |
| 100 this.showAddLanguagesDialog_ = false; | 100 this.showAddLanguagesDialog_ = false; |
| 101 cr.ui.focusWithoutInk(assert(this.$.addLanguages)); | 101 cr.ui.focusWithoutInk(assert(this.$.addLanguages)); |
| 102 }.bind(this)); | 102 }); |
| 103 }); | 103 }); |
| 104 }, | 104 }, |
| 105 | 105 |
| 106 /** | 106 /** |
| 107 * Used to determine which "Move" buttons to show for ordering enabled | 107 * Used to determine which "Move" buttons to show for ordering enabled |
| 108 * languages. | 108 * languages. |
| 109 * @param {number} n | 109 * @param {number} n |
| 110 * @param {!LanguageState} language | 110 * @param {!LanguageState} language |
| 111 * @return {boolean} True if |language| is at the |n|th index in the list of | 111 * @return {boolean} True if |language| is at the |n|th index in the list of |
| 112 * enabled languages. | 112 * enabled languages. |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 if (e.target.tagName == expandButtonTag) | 564 if (e.target.tagName == expandButtonTag) |
| 565 return; | 565 return; |
| 566 | 566 |
| 567 /** @type {!CrExpandButtonElement} */ | 567 /** @type {!CrExpandButtonElement} */ |
| 568 var expandButton = e.currentTarget.querySelector(expandButtonTag); | 568 var expandButton = e.currentTarget.querySelector(expandButtonTag); |
| 569 assert(expandButton); | 569 assert(expandButton); |
| 570 expandButton.expanded = !expandButton.expanded; | 570 expandButton.expanded = !expandButton.expanded; |
| 571 }, | 571 }, |
| 572 }); | 572 }); |
| 573 })(); | 573 })(); |
| OLD | NEW |