Skip to content

A platform for community discussion. Free, open, simple.

Add new 'jumpToPostId' plugin API method

Régis Hanol3a58dc0858de
diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6
index b2c471af130..5887bed9278 100644
--- a/app/assets/javascripts/discourse/controllers/topic.js.es6
+++ b/app/assets/javascripts/discourse/controllers/topic.js.es6
@@ -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) {
const { post, refresh } = event;
if (!post) { return; }
@@ -477,6 +477,10 @@ export default Ember.Controller.extend(BufferedContent, {
this._jumpToPostId(this.get('model.last_read_post_id'));
},
+ jumpToPostId(postId) {
+ this._jumpToPostId(postId);
+ },
+
toggleMultiSelect() {
this.toggleProperty('multiSelect');
this.appEvents.trigger('post-stream:refresh', { force: true });
diff --git a/app/assets/javascripts/discourse/lib/plugin-api.js.es6 b/app/assets/javascripts/discourse/lib/plugin-api.js.es6
index bc15c489529..4f5c0a021df 100644
--- a/app/assets/javascripts/discourse/lib/plugin-api.js.es6
+++ b/app/assets/javascripts/discourse/lib/plugin-api.js.es6
@@ -26,7 +26,7 @@ import { addGTMPageChangedCallback } from 'discourse/lib/page-tracker';
import { registerCustomAvatarHelper } from 'discourse/helpers/user-avatar';
// 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 {
constructor(version, container) {