Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #384081

    hello devs,
    i’m using latest version of enfold in rtl. i found this topic: https://kriesi.at/support/topic/issues-with-translating-to-farsi-rtl-language/ which addressed a very important issue rtl users have, which is the fact that in responsive screen, the order of the columns are set to present left to right content. for example: if i have 3 columns, the column on the left will be on top, and the column on the right will be at the bottom.

    i was very excited to find this post and i used it in my child theme and it seemed to work great with the columns issues, but it caused another problem:
    please see this page: http://tavit.xpmltd.info/?page_id=790 (also pages 705, 765, 781, 812 which has the same stracture) – on the top section, i have 2 rows on the same color section – the top one is the title, and the one below it is an icon box which should be presented below the title. but when i use the code, the order of these also get reversed- which means the icon box get on top and the title below it. i don’t want that to happen…

    my request to you: is there a way to make the code only reverse the columns on the same row but don’t reverse the order of the rows?
    if one row is above the other=don’t reverse.
    if a column is next to another column on the same row = reverse the order in sated of ltd to rtl.

    this is the only thing me as a rtl user am missing from your great theme.

    • This topic was modified 9 years, 10 months ago by graphico.
    #384172

    Hi!

    Try changing the code to:

    function rtl_columns_fix(){
    ?>
    <script>
    (function($){
    
        var resizeTimeout, sortedReverse = false;
        $(window).resize(function () {
            if (resizeTimeout) {
                window.clearTimeout(resizeTimeout);
            }
            resizeTimeout = window.setTimeout(function () {
                var windowWidth = window.innerWidth;
                if ((windowWidth < 767 && !sortedReverse) || (windowWidth >= 767 && sortedReverse)) {
    
                    var rtlContainer = $('.entry-content-wrapper'); 
    
                    rtlContainer.each(function(){
                    	var rtlCols = $(this).children('.flex_column').not('.av_one_full');
                    	$(this).append(rtlCols.get().reverse());
                    });
    
                    sortedReverse = !sortedReverse;
                }
            }, 100);
        }).trigger("resize");
    
    })(jQuery);
    
    </script>
    <?php
    }
    if(is_rtl()) { 
    	add_action('wp_footer', 'rtl_columns_fix'); 
    }

    Regards,
    Josue

    #385008

    josue, this code is PERFECT!
    i am very thankfull – BEST THEME EVER!

    #385015

    You are welcome, glad to help :)

    Regards,
    Josue

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘rtl – sortedReverse functions problem’ is closed to new replies.