DOM binder fixes (#564)
* Fix incorrect updateValue function * Add source
This commit is contained in:
parent
9d40955fc8
commit
37f0396f1c
@ -22,8 +22,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class DOMSettingsBinder {
|
class DOMSettingsBinder {
|
||||||
constructor({getOptionsContext, transforms=null}) {
|
constructor({getOptionsContext, source=null, transforms=null}) {
|
||||||
this._getOptionsContext = getOptionsContext;
|
this._getOptionsContext = getOptionsContext;
|
||||||
|
this._source = source;
|
||||||
this._defaultScope = 'profile';
|
this._defaultScope = 'profile';
|
||||||
this._dataBinder = new DOMDataBinder({
|
this._dataBinder = new DOMDataBinder({
|
||||||
selector: '[data-setting]',
|
selector: '[data-setting]',
|
||||||
@ -97,7 +98,7 @@ class DOMSettingsBinder {
|
|||||||
}
|
}
|
||||||
settingsTargets.push(target);
|
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) {
|
_transform(value, transform, metadata, element) {
|
||||||
|
@ -108,8 +108,8 @@ class DOMDataBinder {
|
|||||||
|
|
||||||
if (addedNodes.length !== 0 || addedNodes.length !== 0) {
|
if (addedNodes.length !== 0 || addedNodes.length !== 0) {
|
||||||
const observer = this._elementMap.get(target);
|
const observer = this._elementMap.get(target);
|
||||||
if (typeof observer !== 'undefined') {
|
if (typeof observer !== 'undefined' && observer.hasValue) {
|
||||||
observer.updateValue();
|
this._setElementValue(observer.element, observer.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user