Support » Theme: Nisarg » _blank in Menu top level opens in current tab & new tab

  • Resolved danielb96

    (@danielb96)


    I have links to external sites in my primary menu.
    There are 3 cases when I try to use an external link in the menu with “_blank” as the target. (This was added using the “new window” checkbox in the Appearance > Menu page)

    Case 1) It is top level navigation with no children. In this case, _blank opens the link in a new tab but also opens it in the current tab.
    Case 2) It is top level navigation with children. In this case, it just opens in the current window and _blank doesn’t work at all.
    Case 3) It is 2nd level navigation. It works correctly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Falguni

    (@falgunihdesai)

    Hello danielb96,

    Thanks for letting me know about these issues. I have updated the theme meeting all above requirements. Please download the new version of the theme.

    Falguni

    Thank you so much!

    Hi Falguni,

    I still see an error in case we have no href in nisarg.js arround:

    //handles top level menu item having children
        $( '.navbar-nav > li.menu-item > .dropdown-toggle' ).click( function(){
        	if($(this).attr('target') == '_blank')
              window.open(this.href); // $( this ).attr( 'href' );
            else
              window.location = $( this ).attr( 'href' );
        });

    If we have no href (just a button) it should just open the menu and not try to go anywhere.

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘_blank in Menu top level opens in current tab & new tab’ is closed to new replies.