From cb48fffa7eb592d5780ddaa7854713d6ae74557f Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 21 Dec 2015 10:38:15 +1030 Subject: [PATCH] Extract notification settings into an item list --- .../core/js/forum/src/components/SettingsPage.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/framework/core/js/forum/src/components/SettingsPage.js b/framework/core/js/forum/src/components/SettingsPage.js index 497724864..45cf881b0 100644 --- a/framework/core/js/forum/src/components/SettingsPage.js +++ b/framework/core/js/forum/src/components/SettingsPage.js @@ -48,7 +48,7 @@ export default class SettingsPage extends UserPage { FieldSet.component({ label: app.translator.trans('core.forum.settings.notifications_heading'), className: 'Settings-notifications', - children: [NotificationGrid.component({user: this.user})] + children: this.notificationsItems().toArray() }) ); @@ -90,6 +90,19 @@ export default class SettingsPage extends UserPage { return items; } + /** + * Build an item list for the user's notification settings. + * + * @return {ItemList} + */ + notificationsItems() { + const items = new ItemList(); + + items.add('notificationGrid', NotificationGrid.component({user: this.user})); + + return items; + } + /** * Generate a callback that will save a value to the given preference. *