From ec536eba42645b02759a2a7bef3dbc2e6bee362c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 9 Oct 2016 21:36:51 +0200 Subject: [PATCH] Fixed scroll direction of page menu in RTL --- .../js/WoltLabSuite/Core/Ui/Page/Menu/Abstract.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Abstract.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Abstract.js index c798075e3d..2d059d2c52 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Abstract.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Abstract.js @@ -6,7 +6,7 @@ * @license GNU Lesser General Public License * @module WoltLabSuite/Core/Ui/Page/Menu/Abstract */ -define(['Core', 'Environment', 'EventHandler', 'ObjectMap', 'Dom/Traverse', 'Dom/Util', 'Ui/Screen'], function(Core, Environment, EventHandler, ObjectMap, DomTraverse, DomUtil, UiScreen) { +define(['Core', 'Environment', 'EventHandler', 'Language', 'ObjectMap', 'Dom/Traverse', 'Dom/Util', 'Ui/Screen'], function(Core, Environment, EventHandler, Language, ObjectMap, DomTraverse, DomUtil, UiScreen) { "use strict"; var _pageContainer = elById('pageContainer'); @@ -534,7 +534,13 @@ define(['Core', 'Environment', 'EventHandler', 'ObjectMap', 'Dom/Traverse', 'Dom _updateDepth: function(increase) { this._depth += (increase) ? 1 : -1; - this._menu.children[0].style.setProperty('transform', 'translateX(' + (this._depth * -100) + '%)', ''); + var offset = this._depth * -100; + if (Language.get('wcf.global.pageDirection') === 'rtl') { + // reverse logic for RTL + offset *= -1; + } + + this._menu.children[0].style.setProperty('transform', 'translateX(' + offset + '%)', ''); }, _updateButtonState: function() { -- 2.20.1