From f56908ccf6280963792d43e4793c5f96c5a44dcb Mon Sep 17 00:00:00 2001 From: Mohammad Ali Abdel-Qader Date: Thu, 16 Jun 2016 15:25:48 +0300 Subject: [PATCH] Issue #1910546: Sub-lists not show on RTL --- admin_menu.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/admin_menu.js b/admin_menu.js index 2e28b55..925fca8 100644 --- a/admin_menu.js +++ b/admin_menu.js @@ -220,21 +220,31 @@ Drupal.admin.behaviors.destination = function (context, settings, $adminMenu) { */ Drupal.admin.behaviors.hover = function (context, settings, $adminMenu) { // Delayed mouseout. + + // Set show and hide object depend on direction. + var direction = ($('html').attr('dir') == 'ltr') ? 'left' : 'right'; + var show = {}; + show[direction] = 'auto'; + show['display'] = 'block'; + + var hide = {}; + hide[direction] = '-999em'; + hide['display'] = 'none'; $('li.expandable', $adminMenu).hover( function () { // Stop the timer. clearTimeout(this.sfTimer); // Display child lists. $('> ul', this) - .css({left: 'auto', display: 'block'}) + .css(show) // Immediately hide nephew lists. - .parent().siblings('li').children('ul').css({left: '-999em', display: 'none'}); + .parent().siblings('li').children('ul').css(hide); }, function () { // Start the timer. var uls = $('> ul', this); this.sfTimer = setTimeout(function () { - uls.css({left: '-999em', display: 'none'}); + uls.css(hide); }, 400); } ); -- 2.9.0