diff --git a/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 b/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 index 0a2b0462378..775aa1690bf 100644 --- a/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 +++ b/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 @@ -2,6 +2,7 @@ import DiscoveryController from 'discourse/controllers/discovery'; import { queryParams } from 'discourse/controllers/discovery-sortable'; import BulkTopicSelection from 'discourse/mixins/bulk-topic-selection'; import { endWith } from 'discourse/lib/computed'; +import showModal from 'discourse/lib/show-modal'; const controllerOpts = { needs: ['discovery'], @@ -66,10 +67,13 @@ const controllerOpts = { }); }, - resetNew() { this.topicTrackingState.resetNew(); Discourse.Topic.resetNew().then(() => this.send('refresh')); + }, + + dismissReadPosts() { + showModal('dismiss-read', { title: 'topics.bulk.dismiss' }); } }, diff --git a/app/assets/javascripts/discourse/mixins/bulk-topic-selection.js.es6 b/app/assets/javascripts/discourse/mixins/bulk-topic-selection.js.es6 index c0e7650d8b6..705f281a353 100644 --- a/app/assets/javascripts/discourse/mixins/bulk-topic-selection.js.es6 +++ b/app/assets/javascripts/discourse/mixins/bulk-topic-selection.js.es6 @@ -42,6 +42,7 @@ export default Ember.Mixin.create({ }); tracker.incrementMessageCount(); } + self.send('closeModal'); self.send('refresh'); }); } diff --git a/app/assets/javascripts/discourse/routes/discovery.js.es6 b/app/assets/javascripts/discourse/routes/discovery.js.es6 index 83b5b4186b4..12b3e1f180c 100644 --- a/app/assets/javascripts/discourse/routes/discovery.js.es6 +++ b/app/assets/javascripts/discourse/routes/discovery.js.es6 @@ -46,6 +46,10 @@ const DiscoveryRoute = Discourse.Route.extend(OpenComposer, { createTopic() { this.openComposer(this.controllerFor("discovery/topics")); + }, + + dismissRead(operationType) { + this.controllerFor("discovery/topics").send('dismissRead', operationType); } } diff --git a/app/assets/javascripts/discourse/templates/discovery/topics.hbs b/app/assets/javascripts/discourse/templates/discovery/topics.hbs index b57679afc79..8af62789372 100644 --- a/app/assets/javascripts/discourse/templates/discovery/topics.hbs +++ b/app/assets/javascripts/discourse/templates/discovery/topics.hbs @@ -5,8 +5,7 @@ {{#if showDismissAtTop}}
+ {{i18n 'topics.bulk.dismiss_body'}} +
+