From: Alexander Ebert Date: Sun, 9 Oct 2016 19:36:51 +0000 (+0200) Subject: Fixed scroll direction of page menu in RTL X-Git-Tag: 3.0.0_Beta_3~50^2~35 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ec536eba42645b02759a2a7bef3dbc2e6bee362c;p=GitHub%2FWoltLab%2FWCF.git Fixed scroll direction of page menu in RTL --- 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() {