Skip to content

Instantly share code, notes, and snippets.

@csavoronin
Last active Feb 25, 2020
Embed
What would you like to do?
[!] Design: Responsive: Menu: 4.9.x: On iOS 13, the second level menu did not work. Fixed. Information about applying changes: http://docs.cs-cart.com/latest/upgrade/apply_diff_file.html
diff --git a/js/tygh/responsive.js b/js/tygh/responsive.js
index df79fd47ac..9a2f243acc 100644
--- a/js/tygh/responsive.js
+++ b/js/tygh/responsive.js
@@ -157,20 +157,31 @@
$('.ty-menu__submenu-to-right').removeClass('ty-menu__submenu-to-right');
var submenu, position;
+ // FIXEME: iOS 13 bug with visibility: hidden
// Detect menu collisions
- if(menuItemElm) {
- if(typeof menuItemElm.offset() !== "undefined") {
- menuWidth = menuWidth - (menuItemElm.offset().left - menuOffset.left)
- }
- submenu = $('.cm-responsive-menu-submenu', menuItemElm).first();
+ // if(menuItemElm) {
+ // if(typeof menuItemElm.offset() !== "undefined") {
+ // menuWidth = menuWidth - (menuItemElm.offset().left - menuOffset.left)
+ // }
+ // submenu = $('.cm-responsive-menu-submenu', menuItemElm).first();
- if(submenu.length) {
- submenu.css({visibility: "hidden", left: 0});
- position = submenu.outerWidth();
- if(position > menuWidth) {
+ // if(submenu.length) {
+ // submenu.css({visibility: "hidden", left: 0});
+ // position = submenu.outerWidth();
+ // if(position > menuWidth) {
+ // submenu.parent().addClass('ty-menu__submenu-to-right');
+ // }
+ // submenu.css({visibility: "", left: "auto"});
+ // }
+
+ // }
+ if (menuItemElm) {
+ var submenu = $('.cm-responsive-menu-submenu', menuItemElm);
+ if (submenu.length) {
+ var position = submenu.position().left + submenu.width();
+ if (position > menuWidth) {
submenu.parent().addClass('ty-menu__submenu-to-right');
}
- submenu.css({visibility: "", left: "auto"});
}
}
@mustafa2731
Copy link

mustafa2731 commented Feb 2, 2020

with which code did I need to take to replace it .

if possible please let me know the process to edit indetail

appreciate your support

@csavoronin
Copy link
Author

csavoronin commented Feb 3, 2020

The fix should be included in the next CS-Cart release.

If you want to apply in in CS-Cart version 4.9.x, you can use this diff file.
If you want to apply in in CS-Cart version 4.10.x, you can use the following diff file:
https://gist.github.com/csavoronin/4ae71b395c267488d51c7dba3d4530e5

For more information about applying changes, please refer to the following article:
http://docs.cs-cart.com/latest/upgrade/apply_diff_file.html

Thank you.

@yorgosf
Copy link

yorgosf commented Feb 24, 2020

hi Sir it is not clear enough how we can fix this bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment