mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:09:00 +08:00
FIX: Order the homepage box in the same order as the top menu
This is required because "no interface" is the same as showing the first entry. But when the top menu has changed the first entry is no longer the same, so it shows the wrong default.
This commit is contained in:
parent
e8559f222c
commit
68d0d39ab7
|
@ -57,16 +57,24 @@ export default Ember.Controller.extend(PreferencesTabController, {
|
||||||
},
|
},
|
||||||
|
|
||||||
homeChanged() {
|
homeChanged() {
|
||||||
const siteHome = Discourse.SiteSettings.top_menu.split("|")[0].split(",")[0];
|
const siteHome = this.siteSettings.top_menu.split("|")[0].split(",")[0];
|
||||||
const userHome = USER_HOMES[this.get('model.user_option.homepage_id')];
|
const userHome = USER_HOMES[this.get('model.user_option.homepage_id')];
|
||||||
|
|
||||||
setDefaultHomepage(userHome || siteHome);
|
setDefaultHomepage(userHome || siteHome);
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed()
|
@computed()
|
||||||
userSelectableHome() {
|
userSelectableHome() {
|
||||||
return _.map(USER_HOMES, (name, num) => {
|
let homeValues = _.invert(USER_HOMES);
|
||||||
return {name: I18n.t('filters.' + name + '.title'), value: Number(num)};
|
|
||||||
|
let result = [];
|
||||||
|
this.siteSettings.top_menu.split('|').forEach(m => {
|
||||||
|
let id = homeValues[m];
|
||||||
|
if (id) {
|
||||||
|
result.push({ name: I18n.t(`filters.${m}.title`), value: Number(id) });
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user