aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/generic-setting-controller.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-10-08 17:38:18 -0400
committerGitHub <noreply@github.com>2020-10-08 17:38:18 -0400
commit41ead7a90ac6d2c2674b647dde3928dbf156bc9c (patch)
tree9c4f0782502c74eebce1217666f50df58432b230 /ext/bg/js/settings/generic-setting-controller.js
parent05e51a950e3fb7da3f9a252a742c068a9daad6b2 (diff)
Add additional transforms (#899)
Diffstat (limited to 'ext/bg/js/settings/generic-setting-controller.js')
-rw-r--r--ext/bg/js/settings/generic-setting-controller.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/bg/js/settings/generic-setting-controller.js b/ext/bg/js/settings/generic-setting-controller.js
index de218816..aa20dbbc 100644
--- a/ext/bg/js/settings/generic-setting-controller.js
+++ b/ext/bg/js/settings/generic-setting-controller.js
@@ -34,7 +34,9 @@ class GenericSettingController {
['setDocumentAttribute', this._setDocumentAttribute.bind(this)],
['setRelativeAttribute', this._setRelativeAttribute.bind(this)],
['splitTags', this._splitTags.bind(this)],
- ['joinTags', this._joinTags.bind(this)]
+ ['joinTags', this._joinTags.bind(this)],
+ ['toNumber', this._toNumber.bind(this)],
+ ['toString', this._toString.bind(this)]
]);
}
@@ -156,4 +158,12 @@ class GenericSettingController {
}
return node;
}
+
+ _toNumber(value, metadata, element) {
+ return DOMDataBinder.convertToNumber(value, element.dataset);
+ }
+
+ _toString(value) {
+ return `${value}`;
+ }
}