diff --git a/app/assets/javascripts/discourse/lib/plugin-api.js.es6 b/app/assets/javascripts/discourse/lib/plugin-api.js.es6 index b8eeb0fe7fc..8c045179656 100644 --- a/app/assets/javascripts/discourse/lib/plugin-api.js.es6 +++ b/app/assets/javascripts/discourse/lib/plugin-api.js.es6 @@ -75,7 +75,9 @@ class PluginApi { * ``` **/ addPosterIcon(cb) { - decorateWidget('poster-name:after', dec => { + const mobileView = this.container.lookup('site:main').mobileView; + const loc = mobileView ? 'before' : 'after'; + decorateWidget(`poster-name:${loc}`, dec => { const attrs = dec.attrs; const result = cb(attrs.userCustomFields || {}, attrs); @@ -102,7 +104,7 @@ class PluginApi { } - return dec.h('span', + return dec.h('span.poster-icon', { className: result.className, attributes: { title: result.title } }, iconBody); } diff --git a/app/assets/stylesheets/mobile/topic-post.scss b/app/assets/stylesheets/mobile/topic-post.scss index fdcc9e192e4..f8ba909fa20 100644 --- a/app/assets/stylesheets/mobile/topic-post.scss +++ b/app/assets/stylesheets/mobile/topic-post.scss @@ -486,9 +486,13 @@ span.highlighted { .names { margin: 5px 0 0 5px; line-height: 17px; - span { + span.full-name, span.user-title, span.username { display: block; } + + .poster-icon { + float: right; + } } .post-info { float: right;