Mooeypoo has uploaded a new change for review.

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


Change subject: [WIP] A quickfix for arrow movements in RTL wikis.
......................................................................

[WIP] A quickfix for arrow movements in RTL wikis.

This will make sure the marker moves correctly (backwards/forward)
in RTL languages as well as LTR languages, judging from the wiki pageLanguage.
This can be a quickfix until the movement can be decided per the direction
of the specific element (span/paragraph/div) the marker is in.

Bug: 38546
Change-Id: Ic01e110a5e6094cd275327a2e8cea90c900f1bd1
---
M modules/ve/ce/ve.ce.Surface.js
1 file changed, 6 insertions(+), 1 deletion(-)


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

diff --git a/modules/ve/ce/ve.ce.Surface.js b/modules/ve/ce/ve.ce.Surface.js
index b761ae5..d7e1e38 100644
--- a/modules/ve/ce/ve.ce.Surface.js
+++ b/modules/ve/ce/ve.ce.Surface.js
@@ -916,7 +916,12 @@
        // Stop with final poll cycle so we have correct information in model
        this.surfaceObserver.stop( true );
        selection = this.model.getSelection();
-       offsetDelta = e.keyCode === ve.Keys.LEFT ? -1 : 1;
+       if ( mw.config.get( 'wgVisualEditor' ).pageLanguageDir == 'rtl' ) {
+               // If the language direction is RTL, switch left/right 
directions:
+               offsetDelta = e.keyCode === ve.Keys.LEFT ? 1 : -1;
+       } else {
+               offsetDelta = e.keyCode === ve.Keys.LEFT ? -1 : 1;
+       }
 
        // Check for selecting/deselecting inline images and aliens
        if ( selection.isCollapsed() ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic01e110a5e6094cd275327a2e8cea90c900f1bd1
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