Skip to content

Instantly share code, notes, and snippets.

@csavoronin csavoronin/24865_49x.patch Secret
Last active Oct 23, 2019

Embed
What would you like to do?
[!] Design: Responsive: Menu: 4.9.x: On iOS 13, the second level menu did not work. Fixed.
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"});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.