From 41ead7a90ac6d2c2674b647dde3928dbf156bc9c Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Thu, 8 Oct 2020 17:38:18 -0400 Subject: Add additional transforms (#899) --- ext/bg/js/settings/generic-setting-controller.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'ext/bg') 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}`; + } } -- cgit v1.2.3