diff --git a/app/assets/javascripts/discourse/templates/topic.hbs b/app/assets/javascripts/discourse/templates/topic.hbs index 0cd943b0267..512927f8a28 100644 --- a/app/assets/javascripts/discourse/templates/topic.hbs +++ b/app/assets/javascripts/discourse/templates/topic.hbs @@ -100,7 +100,6 @@ unhidePost="unhidePost" replyToPost="replyToPost" toggleWiki="toggleWiki" - toggleParticipant="toggleParticipant" toggleSummary="toggleSummary" removeAllowedUser="removeAllowedUser" showInvite="showInvite" diff --git a/app/assets/javascripts/discourse/widgets/topic-map.js.es6 b/app/assets/javascripts/discourse/widgets/topic-map.js.es6 index 7c7be61d6e5..c219f2a085e 100644 --- a/app/assets/javascripts/discourse/widgets/topic-map.js.es6 +++ b/app/assets/javascripts/discourse/widgets/topic-map.js.es6 @@ -33,13 +33,10 @@ createWidget('topic-participant', { linkContents.push(h('span.post-count', attrs.post_count.toString())); } - return h('a.poster', { className: state.toggled ? 'toggled' : null, attributes: { title: attrs.username } }, - linkContents - ); - }, - - click() { - this.sendWidgetAction('toggleParticipant', this.attrs); + return h('a.poster.trigger-user-card', { + className: state.toggled ? 'toggled' : null, + attributes: { title: attrs.username, 'data-user-card': attrs.username } + }, linkContents); } }); diff --git a/test/javascripts/widgets/post-test.js.es6 b/test/javascripts/widgets/post-test.js.es6 index 5c853c0dd65..e644558f8af 100644 --- a/test/javascripts/widgets/post-test.js.es6 +++ b/test/javascripts/widgets/post-test.js.es6 @@ -677,7 +677,7 @@ widgetTest("topic map - few posts", { }); widgetTest("topic map - participants", { - template: '{{mount-widget widget="post" args=args toggleParticipant="toggleParticipant"}}', + template: '{{mount-widget widget="post" args=args}}', setup() { this.set('args', { showTopicMap: true, @@ -690,8 +690,6 @@ widgetTest("topic map - participants", { ], userFilters: ['sam', 'codinghorror'] }); - - this.on('toggleParticipant', () => this.participantToggled = true); }, test(assert) { assert.equal(this.$('li.avatars a.poster').length, 3, 'limits to three participants'); @@ -702,9 +700,6 @@ widgetTest("topic map - participants", { assert.equal(this.$('.topic-map-expanded a.poster').length, 4, 'shows all when expanded'); assert.equal(this.$('a.poster.toggled').length, 2, 'two are toggled'); }); - - click('.topic-map-expanded a.poster:eq(0)'); - andThen(() => assert.ok(this.participantToggled)); } });