summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-09 22:45:55 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-09 22:45:55 +0000
commit682e24154f1a22b2de8d4ef4a3042a9b76c147f7 (patch)
tree22e86837342904b68bf6fd725b2ac10a0ba4225e /chrome
parent007550bce823a2055b6fbca39dcc1bc22affc5cd (diff)
downloadchromium_src-682e24154f1a22b2de8d4ef4a3042a9b76c147f7.zip
chromium_src-682e24154f1a22b2de8d4ef4a3042a9b76c147f7.tar.gz
chromium_src-682e24154f1a22b2de8d4ef4a3042a9b76c147f7.tar.bz2
DOMUI: Fix storing checkbox prefs.
The old code only ran value type initialization on DOMContentLoaded, which is now never hit because the Pref* classes are now created on DOMContenteLoaded. BUG=66045 TEST=none Review URL: http://codereview.chromium.org/5688003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68780 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/resources/options/pref_ui.js23
1 files changed, 8 insertions, 15 deletions
diff --git a/chrome/browser/resources/options/pref_ui.js b/chrome/browser/resources/options/pref_ui.js
index 6fcfd89..19b101c 100644
--- a/chrome/browser/resources/options/pref_ui.js
+++ b/chrome/browser/resources/options/pref_ui.js
@@ -22,6 +22,8 @@ cr.define('options', function() {
this.type = 'checkbox';
var self = this;
+ self.initializeValueType(self.getAttribute('value-type'));
+
// Listen to pref changes.
Preferences.getInstance().addEventListener(this.pref,
function(event) {
@@ -57,12 +59,6 @@ cr.define('options', function() {
break;
}
});
-
- // Initialize options.
- this.ownerDocument.addEventListener('DOMContentLoaded',
- function() {
- self.initializeValueType(self.getAttribute('value-type'));
- });
},
/**
@@ -286,6 +282,12 @@ cr.define('options', function() {
*/
decorate: function() {
var self = this;
+
+ var values = self.getAttribute('data-values');
+ if (values) {
+ self.initializeValues(templateData[values]);
+ }
+
// Listen to pref changes.
Preferences.getInstance().addEventListener(this.pref,
function(event) {
@@ -327,15 +329,6 @@ cr.define('options', function() {
break;
}
});
-
- // Initialize options.
- this.ownerDocument.addEventListener('DOMContentLoaded',
- function() {
- var values = self.getAttribute('data-values');
- if (values) {
- self.initializeValues(templateData[values]);
- }
- });
},
/**