mirror of
https://github.com/flarum/core.git
synced 2025-08-08 01:16:52 +02:00
Extract sortMap variable
Also revert previous uncommitted change in dist file
This commit is contained in:
11
framework/core/js/forum/dist/app.js
vendored
11
framework/core/js/forum/dist/app.js
vendored
@@ -22541,15 +22541,16 @@ System.register('flarum/components/IndexPage', ['flarum/extend', 'flarum/compone
|
|||||||
key: 'viewItems',
|
key: 'viewItems',
|
||||||
value: function viewItems() {
|
value: function viewItems() {
|
||||||
var items = new ItemList();
|
var items = new ItemList();
|
||||||
|
var sortMap = app.cache.discussionList.sortMap();
|
||||||
|
|
||||||
var sortOptions = {};
|
var sortOptions = {};
|
||||||
for (var i in app.cache.discussionList.sortMap()) {
|
for (var i in sortMap) {
|
||||||
sortOptions[i] = app.translator.trans('core.forum.index_sort.' + i + '_button');
|
sortOptions[i] = app.translator.trans('core.forum.index_sort.' + i + '_button');
|
||||||
}
|
}
|
||||||
|
|
||||||
items.add('sort', Select.component({
|
items.add('sort', Select.component({
|
||||||
options: sortOptions,
|
options: sortOptions,
|
||||||
value: this.params().sort || Object.keys(app.cache.discussionList.sortMap())[0],
|
value: this.params().sort || Object.keys(sortMap)[0],
|
||||||
onchange: this.changeSort.bind(this)
|
onchange: this.changeSort.bind(this)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -23351,10 +23352,10 @@ System.register('flarum/components/Navigation', ['flarum/Component', 'flarum/com
|
|||||||
var previous = history.getPrevious() || {};
|
var previous = history.getPrevious() || {};
|
||||||
|
|
||||||
return LinkButton.component({
|
return LinkButton.component({
|
||||||
className: 'Button Navigation-back Button--icon',
|
className: 'Button Navigation-back ' + (previous.title ? '' : 'Button--icon'),
|
||||||
href: history.backUrl(),
|
href: history.backUrl(),
|
||||||
icon: 'list-ul',
|
icon: 'chevron-left',
|
||||||
//children: previous.title,
|
children: previous.title,
|
||||||
config: function config() {},
|
config: function config() {},
|
||||||
onclick: function onclick(e) {
|
onclick: function onclick(e) {
|
||||||
if (e.shiftKey || e.ctrlKey || e.metaKey || e.which === 2) return;
|
if (e.shiftKey || e.ctrlKey || e.metaKey || e.which === 2) return;
|
||||||
|
@@ -204,16 +204,17 @@ export default class IndexPage extends Page {
|
|||||||
*/
|
*/
|
||||||
viewItems() {
|
viewItems() {
|
||||||
const items = new ItemList();
|
const items = new ItemList();
|
||||||
|
const sortMap = app.cache.discussionList.sortMap();
|
||||||
|
|
||||||
const sortOptions = {};
|
const sortOptions = {};
|
||||||
for (const i in app.cache.discussionList.sortMap()) {
|
for (const i in sortMap) {
|
||||||
sortOptions[i] = app.translator.trans('core.forum.index_sort.' + i + '_button');
|
sortOptions[i] = app.translator.trans('core.forum.index_sort.' + i + '_button');
|
||||||
}
|
}
|
||||||
|
|
||||||
items.add('sort',
|
items.add('sort',
|
||||||
Select.component({
|
Select.component({
|
||||||
options: sortOptions,
|
options: sortOptions,
|
||||||
value: this.params().sort || Object.keys(app.cache.discussionList.sortMap())[0],
|
value: this.params().sort || Object.keys(sortMap)[0],
|
||||||
onchange: this.changeSort.bind(this)
|
onchange: this.changeSort.bind(this)
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user