Clean up code

This commit is contained in:
Simon Cossar 2015-06-19 14:43:34 -07:00
parent 7cf910a408
commit aa8b06aed2

View File

@ -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);