Mooeypoo has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/75246


Change subject: Quickfix for Transclusion icon in RTL wikis
......................................................................

Quickfix for Transclusion icon in RTL wikis

This fixes the icon position in RTL wikis from right to left.

Bug: 51819
Change-Id: I36cef115017542c461e6d757f1c8bfda92074607
---
M modules/ve/ui/ve.ui.Context.js
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/46/75246/1

diff --git a/modules/ve/ui/ve.ui.Context.js b/modules/ve/ui/ve.ui.Context.js
index 7df3676..521ca2f 100644
--- a/modules/ve/ui/ve.ui.Context.js
+++ b/modules/ve/ui/ve.ui.Context.js
@@ -267,7 +267,7 @@
                        $container = this.$menu;
                        position = { 'y': focusableOffset.top };
                        // HACK: Proper RTL detection plz!
-                       if ( $( 'body' ).is( '.rtl,.ve-rtl' ) ) {
+                       if ( $( 'body' ).is( '.sitedir-rtl' ) ) {
                                position.x = focusableOffset.left;
                                this.popup.align = 'left';
                        } else {
@@ -278,7 +278,12 @@
                        $container = inspector ? this.inspectors.$ : this.$menu;
                        this.popup.align = 'center';
                }
-               this.$.css( { 'left': position.x, 'top': position.y } );
+               // Flip left with right if *wiki* is RTL
+               if ( $( 'body' ).is( '.sitedir-rtl' ) ) {
+                       this.$.css( { 'right': position.x, 'top': position.y } 
);
+               } else {
+                       this.$.css( { 'left': position.x, 'top': position.y } );
+               }
                this.popup.display(
                        position.x,
                        position.y,

-- 
To view, visit https://gerrit.wikimedia.org/r/75246
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I36cef115017542c461e6d757f1c8bfda92074607
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <mor...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to