mirror of
https://github.com/flarum/core.git
synced 2025-08-06 16:36:47 +02:00
Database changes (#11)
* Update core references * Update remaining core references
This commit is contained in:
committed by
Franz Liedke
parent
6b67263f01
commit
c4692d2bcd
@@ -5,17 +5,17 @@ import { truncate } from 'flarum/utils/string';
|
||||
|
||||
export default function addStickyControl() {
|
||||
extend(DiscussionList.prototype, 'requestParams', function(params) {
|
||||
params.include.push('startPost');
|
||||
params.include.push('firstPost');
|
||||
});
|
||||
|
||||
extend(DiscussionListItem.prototype, 'infoItems', function(items) {
|
||||
const discussion = this.props.discussion;
|
||||
|
||||
if (discussion.isSticky() && !this.props.params.q && !discussion.readNumber()) {
|
||||
const startPost = discussion.startPost();
|
||||
if (discussion.isSticky() && !this.props.params.q && !discussion.lastReadPostNumber()) {
|
||||
const firstPost = discussion.firstPost();
|
||||
|
||||
if (startPost) {
|
||||
const excerpt = truncate(startPost.contentPlain(), 175);
|
||||
if (firstPost) {
|
||||
const excerpt = truncate(firstPost.contentPlain(), 175);
|
||||
|
||||
items.add('excerpt', excerpt, -100);
|
||||
}
|
||||
|
Reference in New Issue
Block a user