diff options
-rw-r--r-- | ext/bg/js/settings/dom-settings-binder.js | 5 | ||||
-rw-r--r-- | ext/mixed/js/dom-data-binder.js | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/ext/bg/js/settings/dom-settings-binder.js b/ext/bg/js/settings/dom-settings-binder.js index 0441ec29..4b63859f 100644 --- a/ext/bg/js/settings/dom-settings-binder.js +++ b/ext/bg/js/settings/dom-settings-binder.js @@ -22,8 +22,9 @@ */ class DOMSettingsBinder { - constructor({getOptionsContext, transforms=null}) { + constructor({getOptionsContext, source=null, transforms=null}) { this._getOptionsContext = getOptionsContext; + this._source = source; this._defaultScope = 'profile'; this._dataBinder = new DOMDataBinder({ selector: '[data-setting]', @@ -97,7 +98,7 @@ class DOMSettingsBinder { } settingsTargets.push(target); } - return this._transformResults(await api.modifySettings(settingsTargets), targets); + return this._transformResults(await api.modifySettings(settingsTargets, this._source), targets); } _transform(value, transform, metadata, element) { diff --git a/ext/mixed/js/dom-data-binder.js b/ext/mixed/js/dom-data-binder.js index 05a84240..d46e8087 100644 --- a/ext/mixed/js/dom-data-binder.js +++ b/ext/mixed/js/dom-data-binder.js @@ -108,8 +108,8 @@ class DOMDataBinder { if (addedNodes.length !== 0 || addedNodes.length !== 0) { const observer = this._elementMap.get(target); - if (typeof observer !== 'undefined') { - observer.updateValue(); + if (typeof observer !== 'undefined' && observer.hasValue) { + this._setElementValue(observer.element, observer.value); } } } |