mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
Add new 'jumpToPostId' plugin API method
This commit is contained in:
@ -205,7 +205,7 @@ export default Ember.Controller.extend(BufferedContent, {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// Called the the topmost visible post on the page changes.
|
// Called when the topmost visible post on the page changes.
|
||||||
topVisibleChanged(event) {
|
topVisibleChanged(event) {
|
||||||
const { post, refresh } = event;
|
const { post, refresh } = event;
|
||||||
if (!post) { return; }
|
if (!post) { return; }
|
||||||
@ -477,6 +477,10 @@ export default Ember.Controller.extend(BufferedContent, {
|
|||||||
this._jumpToPostId(this.get('model.last_read_post_id'));
|
this._jumpToPostId(this.get('model.last_read_post_id'));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
jumpToPostId(postId) {
|
||||||
|
this._jumpToPostId(postId);
|
||||||
|
},
|
||||||
|
|
||||||
toggleMultiSelect() {
|
toggleMultiSelect() {
|
||||||
this.toggleProperty('multiSelect');
|
this.toggleProperty('multiSelect');
|
||||||
this.appEvents.trigger('post-stream:refresh', { force: true });
|
this.appEvents.trigger('post-stream:refresh', { force: true });
|
||||||
|
@ -26,7 +26,7 @@ import { addGTMPageChangedCallback } from 'discourse/lib/page-tracker';
|
|||||||
import { registerCustomAvatarHelper } from 'discourse/helpers/user-avatar';
|
import { registerCustomAvatarHelper } from 'discourse/helpers/user-avatar';
|
||||||
|
|
||||||
// If you add any methods to the API ensure you bump up this number
|
// If you add any methods to the API ensure you bump up this number
|
||||||
const PLUGIN_API_VERSION = '0.8.18';
|
const PLUGIN_API_VERSION = '0.8.19';
|
||||||
|
|
||||||
class PluginApi {
|
class PluginApi {
|
||||||
constructor(version, container) {
|
constructor(version, container) {
|
||||||
|
Reference in New Issue
Block a user