From 3a58dc0858de43c6b9048887660c8fbafa5eb1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Sat, 24 Mar 2018 02:43:39 +0100 Subject: [PATCH] Add new 'jumpToPostId' plugin API method --- app/assets/javascripts/discourse/controllers/topic.js.es6 | 6 +++++- app/assets/javascripts/discourse/lib/plugin-api.js.es6 | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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) {