• Resolved Nicolas Troles

    (@nicolas-troles)


    Hi there

    First of all, thanks for the plugin, it’s great!

    We added the flags to our Menu and suddenly it stopped working to translate when clicking on the flag.

    What is wrong?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author edo888

    (@edo888)

    Hi,

    Try to disable smoothscroll plugin and check again. It seems to be a conflict between click event listeners. Flags click event is not getting executed for some reason.

    Thanks! 🙂

    Thread Starter Nicolas Troles

    (@nicolas-troles)

    Hi,

    I disabled the functionality but the translation is not working yet.
    What else can be the problem?

    Thanks 😀

    Plugin Author edo888

    (@edo888)

    Hi,

    The problematic code is located in wp-content/themes/jupiter/assets/js/core-scripts.6.4.0.js, it prevents the click event (preventDefault) to bubble down and reach the flag, so flag is never being clicked actually.

    /**
         * Assign global click handlers
         */
        $( document ).on( 'click', '.js-smooth-scroll, .js-main-nav a', smoothScrollToAnchor);
        $( '.side_dashboard_menu a' ).on( 'click', smoothScrollToAnchor);
    
        function smoothScrollToAnchor( evt ) {
            var anchor = MK.utils.detectAnchor( this );
            var $this = $(evt.currentTarget);
            var loc = window.location;
            var currentPage = loc.origin + loc.pathname;
            var href = $this.attr( 'href' );
            var linkSplit = (href) ? href.split( '#' ) : '';
            var hrefPage  = linkSplit[0] ? linkSplit[0] : ''; 
            var hrefHash  = linkSplit[1] ? linkSplit[1] : '';
    
            if( anchor.length ) {
                if(hrefPage === currentPage || hrefPage === '') evt.preventDefault();
                MK.utils.scrollToAnchor( anchor );
    
            } else if( $this.attr( 'href' ) === '#' ) {
                evt.preventDefault();
            }
        }

    Thanks! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Flags not translating’ is closed to new replies.