yithemes / yith-proteo

Proteo is a sleek, modern and “Gutenberg-friendly” e-commerce theme. Developed with a beautiful UI and a minimal design, is perfect for each kind of shop. Easy to manage and to customize, Proteo is the best solution if you want a complete e-commerce template and start quickly to sell your products with WooCommerce without a technical knowledge. Use it also for corporate site or a blog: there are no limits about what you can do with a beautiful and usable theme like this!
https://proteo.yithemes.com
GNU General Public License v2.0
32 stars 4 forks source link

JS navigation optimization #33

Closed Mte90 closed 2 years ago

Mte90 commented 2 years ago

As per https://github.com/yithemes/yith-proteo/pull/30/ require some testing

francgrasso commented 2 years ago

This pull request removes all the last fixes. Please update to match your intent

Mte90 commented 2 years ago

I think I fixed that issue.

francgrasso commented 2 years ago

Using this pull request, on mobile menu , you cannot visit the link of a menu item containing submenu. The reason is because you are running a prevent default without checking it the item is opened or not. Please add this control to your code and the pull request will be accepted.

if (t.hasClass('submenu-opened')) {
    return true;
} else {
Mte90 commented 2 years ago

In what line?

francgrasso commented 2 years ago

you can replace lines 79. 80, 81 with this:

var t = $(this);
if (t.hasClass('submenu-opened')) {
return true;
} else {
ev.preventDefault();
t.parent().siblings().find('a').removeClass('submenu-opened');
t.addClass('submenu-opened');
}

or, in case you want to avoid a line:

    if ($(this).hasClass('submenu-opened')) {
        return true;
    } else {
        ev.preventDefault();
        $(this).parent().siblings().find('a').removeClass('submenu-opened');
        $(this).addClass('submenu-opened');
    }
francgrasso commented 2 years ago

thanks for your code, merged