Bug 778027 - [Settings API] addObserver & onsettingchange quirks. r=sicking

This commit is contained in:
Gregor Wagner 2012-07-30 13:52:51 -07:00
parent dd2820f364
commit ce0aa8bd3f

View File

@ -268,11 +268,9 @@ SettingsManager.prototype = {
}
if (this._callbacks && this._callbacks[msg.key]) {
debug("observe callback called! " + msg.key + " " + this._callbacks[msg.key].length);
for (let cb in this._callbacks[msg.key]) {
this._callbacks[msg.key].forEach(function(cb) {
cb({settingName: msg.key, settingValue: msg.value});
});
}
this._callbacks[msg.key].forEach(function(cb) {
cb({settingName: msg.key, settingValue: msg.value});
});
}
} else {
debug("no observers stored!");