1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed RTL: No effect when side nav is opened in responsive

Discussion in 'Resolved Bug Reports' started by rellect, Aug 14, 2015.

  1. rellect

    rellect Well-Known Member

    Relevant code (acp_nav.js)
    HTML:
    if (newValue)
    {
        $sidebar.addClass('active');
        recalcSidebarHeight();
    
        $sidebar.css('left', -$sidebar.width()).animate({left: 0}, function()
        {
            $sidebar.css('left', '');
            sidebarActive = true;
            sidebarTransitioning = false;
        });
    }
    else
    {
        $sidebar.animate({left: -$sidebar.width()}, function()
        {
            $sidebar.css('left', '')
                .removeClass('active');
            sidebarActive = false;
            sidebarTransitioning = false;
        });
    }
    The above code does not reverse the effect for RTL.
    Should be something like
    HTML:
    var slideDirection = XenForo.switchStringRTL('left'),
        animateOptions = function(value){
            var options = {};
            options[slideDirection] = value;
            return options;
        };
    
    if (newValue)
    {
        $sidebar.addClass('active');
        recalcSidebarHeight();
    
        $sidebar.css(slideDirection, -$sidebar.width()).animate(animateOptions(0), function()
        {
            $sidebar.css(slideDirection, '');
            sidebarActive = true;
            sidebarTransitioning = false;
        });
    }
    else
    {
        $sidebar.animate(animateOptions(-$sidebar.width()), function()
        {
            $sidebar.css(slideDirection, '').removeClass('active');
            sidebarActive = false;
            sidebarTransitioning = false;
        });
    }
    
     
  2. Mike

    Mike XenForo Developer Staff Member

    This is fixed now, thanks.
     

Share This Page