diff --git a/app/assets/javascripts/discourse/views/user-card.js.es6 b/app/assets/javascripts/discourse/views/user-card.js.es6 index f95fa1475f1..6ed306c4539 100644 --- a/app/assets/javascripts/discourse/views/user-card.js.es6 +++ b/app/assets/javascripts/discourse/views/user-card.js.es6 @@ -84,6 +84,7 @@ export default Discourse.View.extend(CleansUp, { }, _willShow(target) { + const rtl = ($('html').css('direction')) === 'rtl'; if (!target) { return; } const width = this.$().width(); @@ -92,8 +93,7 @@ export default Discourse.View.extend(CleansUp, { let position = target.offset(); if (position) { - // Check for a right to left layout - if (($('html').css('direction')) === 'rtl') { + if (rtl) { // The site direction is rtl position.right = $(window).width() - position.left + 10; position.left = 'auto'; const overage = ($(window).width() - 50) - (position.right + width);