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

Unified Diff: chrome/browser/resources/settings/controls/settings_radio_group.js

Issue 2052543002: MD Settings: disable <paper-radio-button>s inside of a <settings-radio-group> when controlled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: asdf Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/settings/controls/settings_radio_group.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/controls/settings_radio_group.js
diff --git a/chrome/browser/resources/settings/controls/settings_radio_group.js b/chrome/browser/resources/settings/controls/settings_radio_group.js
index a9bc71dc07eca16fade086dd9b6e4a54868dce5b..b4b76fcab104741297c6daade946538100f5a923 100644
--- a/chrome/browser/resources/settings/controls/settings_radio_group.js
+++ b/chrome/browser/resources/settings/controls/settings_radio_group.js
@@ -15,9 +15,15 @@
Polymer({
is: 'settings-radio-group',
- behaviors: [PrefControlBehavior],
+ behaviors: [CrPolicyPrefBehavior, PrefControlBehavior],
properties: {
+ disabled_: {
+ observer: 'disabledChanged_',
+ type: Boolean,
+ value: false,
+ },
+
/**
* IronSelectableBehavior selected attribute.
*/
@@ -34,11 +40,22 @@ Polymer({
/** @private */
prefChanged_: function() {
+ this.disabled_ = this.isPrefPolicyControlled(this.pref);
this.selected = Settings.PrefUtil.prefToString(
/** @type {!chrome.settingsPrivate.PrefObject} */(this.pref));
},
/** @private */
+ disabledChanged_: function() {
+ if (this.disabled_) {
michaelpg 2016/06/08 19:23:16 why does this assume policy is never reversed?
Dan Beam 2016/06/09 02:11:33 it doesn't assume this, it was just trying not to
+ var radioButtons = this.queryAllEffectiveChildren('paper-radio-button');
+ for (var i = 0; i < radioButtons.length; ++i) {
+ radioButtons[i].disabled = true;
+ }
+ }
+ },
+
+ /** @private */
selectedChanged_: function(selected) {
if (!this.pref)
return;
« no previous file with comments | « chrome/browser/resources/settings/controls/settings_radio_group.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698