aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/settings-controller.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-10-07 21:23:42 -0400
committerGitHub <noreply@github.com>2020-10-07 21:23:42 -0400
commit05e51a950e3fb7da3f9a252a742c068a9daad6b2 (patch)
tree0649a711633648c379adb79ca4b8344d8da001d7 /ext/bg/js/settings/settings-controller.js
parentcb1902eaddeb092bf1e3d78f9e601109bd32202c (diff)
Settings templates refactor (#897)
* Add template instantiation API to SettingsController * Use SettingsController.instantiateTemplate
Diffstat (limited to 'ext/bg/js/settings/settings-controller.js')
-rw-r--r--ext/bg/js/settings/settings-controller.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/bg/js/settings/settings-controller.js b/ext/bg/js/settings/settings-controller.js
index f4ddf6fb..827d837b 100644
--- a/ext/bg/js/settings/settings-controller.js
+++ b/ext/bg/js/settings/settings-controller.js
@@ -16,6 +16,7 @@
*/
/* global
+ * HtmlTemplateCollection
* api
*/
@@ -26,6 +27,7 @@ class SettingsController extends EventDispatcher {
this._source = generateId(16);
this._pageExitPreventions = new Set();
this._pageExitPreventionEventListeners = new EventListenerCollection();
+ this._templates = new HtmlTemplateCollection(document);
}
get source() {
@@ -110,6 +112,14 @@ class SettingsController extends EventDispatcher {
return obj;
}
+ instantiateTemplate(name) {
+ return this._templates.instantiate(name);
+ }
+
+ instantiateTemplateFragment(name) {
+ return this._templates.instantiateFragment(name);
+ }
+
// Private
_setProfileIndex(value) {