mirror of
https://github.com/flarum/framework.git
synced 2025-06-06 07:54:32 +08:00
Extract notification settings into an item list
This commit is contained in:
@ -48,7 +48,7 @@ export default class SettingsPage extends UserPage {
|
|||||||
FieldSet.component({
|
FieldSet.component({
|
||||||
label: app.translator.trans('core.forum.settings.notifications_heading'),
|
label: app.translator.trans('core.forum.settings.notifications_heading'),
|
||||||
className: 'Settings-notifications',
|
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;
|
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.
|
* Generate a callback that will save a value to the given preference.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user