Jump to content

Edit History

AfterGlow93

AfterGlow93

  On 10/9/2020 at 1:30 PM, @rthur said:

Oui il est fourni par eux. Le module de menu c'est le menu de base modifié j'imagine car il se trouve dans le repertoire ps_mainmenu. Il y a effectivement dans le js des mentions du "submenu width" mais je n'y comprends rien en js donc je vais essayer de contacter JHP...

J'ai essayé de commenter cette partie mais ca ne change rien : 

	function DesktopMenu(jhp){
		if (document.body.clientWidth > mobileViewSize) 
		{
			var obj = jhp;
			var extraWidth = 0;
			var new_width_popup = 0;
			var wrapWidthPopup = $(obj).find('.jhpmain-menu-sub-menu').outerWidth(true);
			var wrapHeightPopup = $(obj).find('.jhpmain-menu-sub-menu').outerHeight(true);				
			var actualWidthPopup = $(obj).find('.jhpmain-menu-sub-menu').width();
			extraWidth = wrapWidthPopup - actualWidthPopup;
			var new_width_popup = $(obj).find('.jhpmain-menu-sub-menu .top-menu').outerWidth(true);
		/*	var menuWidth = $('.jhpcmsmain-menu-wrapper').width();
			var subMenuLiWidth = $(obj).find('.jhpmain-menu-sub-menu > ul > li').outerWidth(true);
			var totalSubMenu = $(obj).find('.jhpmain-menu-sub-menu > ul > li').length;  
			var popupFinalWidth = (totalSubMenu * subMenuLiWidth)+60; */
			var menuTopOffset = $(".jhpcmsdesktop-wrapper-navbar").offset();//menu top margin or other spacing
			var menuLiHeightOffset  = $(obj).offset();//menu inside top position like table
			var menuLiHeight  = $(obj).outerHeight(true);//line height of menu
			var menuPopopTop  = (menuLiHeightOffset.top - menuTopOffset.top) + menuLiHeight -95;

			var new_outer_width_popup = new_width_popup + extraWidth;
			if(popupFinalWidth > menuWidth){
				popupFinalWidth = menuWidth+20;
			}
			if(popupFinalWidth > new_outer_width_popup){
				new_outer_width_popup = popupFinalWidth+20;
			}
			if(wrapHeightPopup >= 400){//auto scroll when popup is bigger
				$(obj).find('.jhpmain-menu-sub-menu').addClass('jhp-auto-scroll');
			}else{
				$(obj).find('.jhpmain-menu-sub-menu').removeClass('jhp-auto-scroll');
			}
			var wraper = $('.jhpcmsmain-menu-wrapper');
			var wWraper = wraper.outerWidth();
			var posWraper = wraper.offset();
			var pos = $(obj).offset();
			var xLeft = pos.left - posWraper.left;
			if ((xLeft + new_outer_width_popup) > wWraper) xLeft = wWraper - new_outer_width_popup;
			$(obj).find('.jhpmain-menu-sub-menu').css('left', xLeft);
			$(obj).find('.jhpmain-menu-sub-menu').css('top',menuPopopTop);
			$(obj).find('.jhpmain-menu-sub-menu').css('width', popupFinalWidth);
			
			//$(obj).find('.jhpmain-menu-sub-menu').stop(true, true).slideDown(500, 'swing');//show popup
			$(obj).find('.jhpmain-menu-sub-menu').addClass('jhp-desk-open');
			
		}

 

Expand  

Attention, regarde la fonction : if (document.body.clientWidth > mobileViewSize)

Ca concerne le mobile uniquement, tu dois avoir autre chose avec cette fonction "DesktopMenu" . 

Sur le mobile, tu avais un wrapper qui prenait tout l'écran du téléphone, il a disparu (pas pratique du coup) : 

image.png.c4988b57766f436ec0488c12d4bf5364.png

Pour tester en mobile, la vue Mobile View du DevMode de Google chrome t'aidera (ou en redimensionnant la fenêtre, par exemple)

AfterGlow93

AfterGlow93

  On 10/9/2020 at 1:30 PM, @rthur said:

Oui il est fourni par eux. Le module de menu c'est le menu de base modifié j'imagine car il se trouve dans le repertoire ps_mainmenu. Il y a effectivement dans le js des mentions du "submenu width" mais je n'y comprends rien en js donc je vais essayer de contacter JHP...

J'ai essayé de commenter cette partie mais ca ne change rien : 

	function DesktopMenu(jhp){
		if (document.body.clientWidth > mobileViewSize) 
		{
			var obj = jhp;
			var extraWidth = 0;
			var new_width_popup = 0;
			var wrapWidthPopup = $(obj).find('.jhpmain-menu-sub-menu').outerWidth(true);
			var wrapHeightPopup = $(obj).find('.jhpmain-menu-sub-menu').outerHeight(true);				
			var actualWidthPopup = $(obj).find('.jhpmain-menu-sub-menu').width();
			extraWidth = wrapWidthPopup - actualWidthPopup;
			var new_width_popup = $(obj).find('.jhpmain-menu-sub-menu .top-menu').outerWidth(true);
		/*	var menuWidth = $('.jhpcmsmain-menu-wrapper').width();
			var subMenuLiWidth = $(obj).find('.jhpmain-menu-sub-menu > ul > li').outerWidth(true);
			var totalSubMenu = $(obj).find('.jhpmain-menu-sub-menu > ul > li').length;  
			var popupFinalWidth = (totalSubMenu * subMenuLiWidth)+60; */
			var menuTopOffset = $(".jhpcmsdesktop-wrapper-navbar").offset();//menu top margin or other spacing
			var menuLiHeightOffset  = $(obj).offset();//menu inside top position like table
			var menuLiHeight  = $(obj).outerHeight(true);//line height of menu
			var menuPopopTop  = (menuLiHeightOffset.top - menuTopOffset.top) + menuLiHeight -95;

			var new_outer_width_popup = new_width_popup + extraWidth;
			if(popupFinalWidth > menuWidth){
				popupFinalWidth = menuWidth+20;
			}
			if(popupFinalWidth > new_outer_width_popup){
				new_outer_width_popup = popupFinalWidth+20;
			}
			if(wrapHeightPopup >= 400){//auto scroll when popup is bigger
				$(obj).find('.jhpmain-menu-sub-menu').addClass('jhp-auto-scroll');
			}else{
				$(obj).find('.jhpmain-menu-sub-menu').removeClass('jhp-auto-scroll');
			}
			var wraper = $('.jhpcmsmain-menu-wrapper');
			var wWraper = wraper.outerWidth();
			var posWraper = wraper.offset();
			var pos = $(obj).offset();
			var xLeft = pos.left - posWraper.left;
			if ((xLeft + new_outer_width_popup) > wWraper) xLeft = wWraper - new_outer_width_popup;
			$(obj).find('.jhpmain-menu-sub-menu').css('left', xLeft);
			$(obj).find('.jhpmain-menu-sub-menu').css('top',menuPopopTop);
			$(obj).find('.jhpmain-menu-sub-menu').css('width', popupFinalWidth);
			
			//$(obj).find('.jhpmain-menu-sub-menu').stop(true, true).slideDown(500, 'swing');//show popup
			$(obj).find('.jhpmain-menu-sub-menu').addClass('jhp-desk-open');
			
		}

 

Expand  

Attention, regarde la fonction : if (document.body.clientWidth > mobileViewSize)

Ca concerne le mobile uniquement, tu dois avoir autre chose avec cette fonction "DesktopMenu" . 

Pour tester en mobile, la vue Mobile View du DevMode de Google chrome t'aidera (ou en redimensionnant la fenêtre, par exemple)

AfterGlow93

AfterGlow93

  On 10/9/2020 at 1:30 PM, @rthur said:

Oui il est fourni par eux. Le module de menu c'est le menu de base modifié j'imagine car il se trouve dans le repertoire ps_mainmenu. Il y a effectivement dans le js des mentions du "submenu width" mais je n'y comprends rien en js donc je vais essayer de contacter JHP...

J'ai essayé de commenter cette partie mais ca ne change rien : 

	function DesktopMenu(jhp){
		if (document.body.clientWidth > mobileViewSize) 
		{
			var obj = jhp;
			var extraWidth = 0;
			var new_width_popup = 0;
			var wrapWidthPopup = $(obj).find('.jhpmain-menu-sub-menu').outerWidth(true);
			var wrapHeightPopup = $(obj).find('.jhpmain-menu-sub-menu').outerHeight(true);				
			var actualWidthPopup = $(obj).find('.jhpmain-menu-sub-menu').width();
			extraWidth = wrapWidthPopup - actualWidthPopup;
			var new_width_popup = $(obj).find('.jhpmain-menu-sub-menu .top-menu').outerWidth(true);
		/*	var menuWidth = $('.jhpcmsmain-menu-wrapper').width();
			var subMenuLiWidth = $(obj).find('.jhpmain-menu-sub-menu > ul > li').outerWidth(true);
			var totalSubMenu = $(obj).find('.jhpmain-menu-sub-menu > ul > li').length;  
			var popupFinalWidth = (totalSubMenu * subMenuLiWidth)+60; */
			var menuTopOffset = $(".jhpcmsdesktop-wrapper-navbar").offset();//menu top margin or other spacing
			var menuLiHeightOffset  = $(obj).offset();//menu inside top position like table
			var menuLiHeight  = $(obj).outerHeight(true);//line height of menu
			var menuPopopTop  = (menuLiHeightOffset.top - menuTopOffset.top) + menuLiHeight -95;

			var new_outer_width_popup = new_width_popup + extraWidth;
			if(popupFinalWidth > menuWidth){
				popupFinalWidth = menuWidth+20;
			}
			if(popupFinalWidth > new_outer_width_popup){
				new_outer_width_popup = popupFinalWidth+20;
			}
			if(wrapHeightPopup >= 400){//auto scroll when popup is bigger
				$(obj).find('.jhpmain-menu-sub-menu').addClass('jhp-auto-scroll');
			}else{
				$(obj).find('.jhpmain-menu-sub-menu').removeClass('jhp-auto-scroll');
			}
			var wraper = $('.jhpcmsmain-menu-wrapper');
			var wWraper = wraper.outerWidth();
			var posWraper = wraper.offset();
			var pos = $(obj).offset();
			var xLeft = pos.left - posWraper.left;
			if ((xLeft + new_outer_width_popup) > wWraper) xLeft = wWraper - new_outer_width_popup;
			$(obj).find('.jhpmain-menu-sub-menu').css('left', xLeft);
			$(obj).find('.jhpmain-menu-sub-menu').css('top',menuPopopTop);
			$(obj).find('.jhpmain-menu-sub-menu').css('width', popupFinalWidth);
			
			//$(obj).find('.jhpmain-menu-sub-menu').stop(true, true).slideDown(500, 'swing');//show popup
			$(obj).find('.jhpmain-menu-sub-menu').addClass('jhp-desk-open');
			
		}

 

Expand  

Attention, regarde la fonction : if (document.body.clientWidth > mobileViewSize)

Ca concerne le mobile uniquement, tu dois avoir autre chose avec ce "if" . 

Pour tester en mobile, la vue Mobile View du DevMode de Google chrome t'aidera (ou en redimensionnant la fenêtre, par exemple)

×
×
  • Create New...