mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 21:23:45 +08:00
Clean up code
This commit is contained in:
parent
7cf910a408
commit
aa8b06aed2
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user