mirror of
https://github.com/flarum/framework.git
synced 2024-11-26 02:10:09 +08:00
Don't clear the discussion list when loading new results
This commit is contained in:
parent
e15afa0613
commit
f0100ca7c0
|
@ -5,6 +5,7 @@ import app from 'flarum/app';
|
|||
import DiscussionList from 'flarum/components/DiscussionList';
|
||||
import DiscussionPage from 'flarum/components/DiscussionPage';
|
||||
import IndexPage from 'flarum/components/IndexPage';
|
||||
import Button from 'flarum/components/Button';
|
||||
|
||||
app.initializers.add('pusher', () => {
|
||||
const loadPusher = m.deferred();
|
||||
|
@ -52,16 +53,20 @@ app.initializers.add('pusher', () => {
|
|||
|
||||
if (count) {
|
||||
vdom.children.unshift(
|
||||
<button className="Button Button--block DiscussionList-update"
|
||||
onclick={() => {
|
||||
app.pushedUpdates = [];
|
||||
this.refresh();
|
||||
}}
|
||||
config={(element, isInitialized) => {
|
||||
if (!isInitialized) $(element).hide().fadeIn();
|
||||
}}>
|
||||
{app.trans('pusher.show_updated_discussions', {count})}
|
||||
</button>
|
||||
Button.component({
|
||||
className: 'Button Button--block DiscussionList-update',
|
||||
onclick: () => {
|
||||
this.refresh(false).then(() => {
|
||||
this.loadingUpdated = false;
|
||||
app.pushedUpdates = [];
|
||||
app.setTitleCount(0);
|
||||
m.redraw();
|
||||
});
|
||||
this.loadingUpdated = true;
|
||||
},
|
||||
loading: this.loadingUpdated,
|
||||
children: app.trans('pusher.show_updated_discussions', {count})
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user