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

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

Issue 1132223005: Fix the pref binding by binding to the object rather than the element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fixes
Patch Set: revert accidental change Created 5 years, 7 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 6 * @fileoverview
7 * `cr-settings-checkbox` is a checkbox that controls a supplied preference. 7 * `cr-settings-checkbox` is a checkbox that controls a supplied preference.
8 * 8 *
9 * Example: 9 * Example:
10 * <cr-settings-checkbox pref="{{prefs.settings.enableFoo}}" 10 * <cr-settings-checkbox pref="{{prefs.settings.enableFoo}}"
11 * label="Enable foo setting." subLabel="(bar also)"> 11 * label="Enable foo setting." subLabel="(bar also)">
12 * </cr-settings-checkbox> 12 * </cr-settings-checkbox>
13 * 13 *
14 * @element cr-settings-checkbox 14 * @element cr-settings-checkbox
15 */ 15 */
16 Polymer({ 16 Polymer({
17 is: 'cr-settings-checkbox', 17 is: 'cr-settings-checkbox',
18 18
19 properties: { 19 properties: {
20 /** 20 /**
21 * The boolean preference object to control. 21 * The boolean preference object to control.
22 * @type {?chrome.settingsPrivate.PrefObject} 22 * @type {?chrome.settingsPrivate.PrefObject}
23 */ 23 */
24 pref: Object, 24 pref: {
25 type: Object,
26 notify: true,
27 },
25 28
26 label: { 29 label: {
27 type: String, 30 type: String,
28 value: '', 31 value: '',
29 }, 32 },
30 33
31 subLabel: { 34 subLabel: {
32 type: String, 35 type: String,
33 value: '', 36 value: '',
34 }, 37 },
35 }, 38 },
36 39
37 /** @override */ 40 /** @override */
38 ready: function() { 41 ready: function() {
39 this.$.events.forward(this.$.checkbox, ['change']); 42 this.$.events.forward(this.$.checkbox, ['change']);
40 }, 43 },
41 }); 44 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698