Skip to content

Commit

Permalink
Update magicmenu.js
Browse files Browse the repository at this point in the history
  • Loading branch information
alothemes committed Feb 19, 2021
1 parent 11e25a7 commit 586cde7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions view/frontend/web/js/magicmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @license https://www.magepow.com/license-agreement.html
* @Author: DOng NGuyen<[email protected]>
* @@Create Date: 2014-04-25 13:16:48
* @@Modify Date: 2020-10-28 09:16:29
* @@Modify Date: 2021-10-19 09:16:29
* @@Function:
*/
require(['jquery', 'magiccart/easing'], function($, easing){
Expand Down Expand Up @@ -325,19 +325,18 @@ require(['jquery', 'magiccart/easing'], function($, easing){
},

megamenu: function (menu) {
var isHorizontal = menu.hasClass('magicmenu');
// Topmenu
var navDesktop = menu.find('.nav-desktop');
if(navDesktop.hasClass('sticker')) methods.sticky(menu);
if(isHorizontal && navDesktop.hasClass('sticker')) methods.sticky(menu);
/* Active menu top-vmega */
menu.find('.vmega .category-item').on('hover mouseenter', function() {
$(this).siblings().removeClass('over');
$(this).addClass('over');
});
var fullWidth = navDesktop.data('fullwidth');
if( navDesktop.data('breakpoint') ) breakpoint = navDesktop.data('breakpoint');
var leveltop = menu.find('li.level0.hasChild, li.level0.home').not('.dropdown');
// is Horizontal
var isHorizontal = menu.hasClass('magicmenu');
var leveltop = navDesktop.find('li.level0.hasChild, li.level0.home').not('.dropdown');
methods.toggleVertical(menu);
if(isHorizontal) methods.horizontal(leveltop, fullWidth, true);
else methods.vertical(leveltop, fullWidth, true);
Expand All @@ -347,13 +346,14 @@ require(['jquery', 'magiccart/easing'], function($, easing){
if ( breakpoint > $(window).width()){
body.addClass('nav-mobile-display');
$('.nav-mobile').show();
navDesktop.hide();
if(isHorizontal) navDesktop.hide();
} else {
body.removeClass('nav-mobile-display');
$('.nav-mobile').hide();
navDesktop.show();
if(isHorizontal) methods.horizontal(leveltop, fullWidth, true);
else methods.vertical(leveltop, fullWidth, true);
if(isHorizontal){
navDesktop.show();
methods.horizontal(leveltop, fullWidth, true);
}else methods.vertical(leveltop, fullWidth, true);
}
});

Expand Down

0 comments on commit 586cde7

Please sign in to comment.