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

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

Issue 2683583008: MD Settings: Convert spell-check from checkbox to toggle. (Closed)
Patch Set: Another way to implement disabledness Created 3 years, 10 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 /** @private */ 59 /** @private */
60 showAddLanguagesDialog_: Boolean, 60 showAddLanguagesDialog_: Boolean,
61 }, 61 },
62 62
63 /** 63 /**
64 * Handler for enabling or disabling spell check. 64 * Handler for enabling or disabling spell check.
65 * @param {!{target: Element, model: !{item: !LanguageState}}} e 65 * @param {!{target: Element, model: !{item: !LanguageState}}} e
66 */ 66 */
67 onSpellCheckChange_: function(e) { 67 onSpellCheckChange_: function(e) {
68 this.languageHelper.toggleSpellCheck(e.model.item.language.code, 68 var item = e.model.item;
69 e.target.checked); 69 if(!item.language.supportsSpellcheck) {
Dan Beam 2017/02/09 20:11:19 space after if
scottchen 2017/02/09 21:30:13 Done.
70 return;
71 }
Dan Beam 2017/02/09 20:11:18 no curlies
scottchen 2017/02/09 21:30:13 Done.
72
73 this.languageHelper.toggleSpellCheck(item.language.code,
74 !item.spellCheckEnabled);
70 }, 75 },
71 76
72 /** @private */ 77 /** @private */
73 onBackTap_: function() { 78 onBackTap_: function() {
74 this.$.pages.back(); 79 this.$.pages.back();
75 }, 80 },
76 81
77 /** 82 /**
78 * Stamps and opens the Add Languages dialog, registering a listener to 83 * Stamps and opens the Add Languages dialog, registering a listener to
79 * disable the dialog's dom-if again on close. 84 * disable the dialog's dom-if again on close.
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 if (e.target.tagName == expandButtonTag) 549 if (e.target.tagName == expandButtonTag)
545 return; 550 return;
546 551
547 /** @type {!CrExpandButtonElement} */ 552 /** @type {!CrExpandButtonElement} */
548 var expandButton = e.currentTarget.querySelector(expandButtonTag); 553 var expandButton = e.currentTarget.querySelector(expandButtonTag);
549 assert(expandButton); 554 assert(expandButton);
550 expandButton.expanded = !expandButton.expanded; 555 expandButton.expanded = !expandButton.expanded;
551 }, 556 },
552 }); 557 });
553 })(); 558 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698