Skip to content

Commit

Permalink
Fix bug cannot click on off-canvas menu item
Browse files Browse the repository at this point in the history
Fix #359
  • Loading branch information
khanhlh committed Dec 30, 2014
1 parent 0f70725 commit 3c809ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/plg_system_t3/base-bs3/js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,11 @@
var $this = $(this),
data = $this.data('megamenu'),
options = typeof option == 'object' && option;


// Ignore off-canvas navigation
if ($this.parents('#off-canvas-nav').length) return ;
if ($this.parents('#t3-off-canvas').length) return ;

if (!data) {
$this.data('megamenu', (data = new T3Menu(this, options)));

Expand Down
4 changes: 4 additions & 0 deletions source/plg_system_t3/base/js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,10 @@
data = $this.data('megamenu'),
options = typeof option == 'object' && option;

// Ignore off-canvas navigation
if ($this.parents('#off-canvas-nav').length) return ;
if ($this.parents('#t3-off-canvas').length) return ;

if (!data) {
$this.data('megamenu', (data = new T3Menu(this, options)));

Expand Down

6 comments on commit 3c809ee

@mino182
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, there should be something like this:
if ($('html').hasClass("touch")) return;

Because there are larger touch devices, where grid breakpoint doesn't collapse menu or show off-canvas. And problem with lagging in megamenu submenus don't disappear. That line solve this problem, but I don't know if it is best solution.

@uncleron12345
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Mino182,
where did you insert
if ($('html').hasClass("touch")) return;
?

My problem is not Off Canvas but the lagging submenus in megamenu on touch displays, for example android tablets or Windows 10 desktops with touch screens.

@mino182
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, into line 394.

@uncleron12345
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. This works on my windows 10 convertible only in chrome by touch. In Firefox it's even not possible to get the main menu item link via touch... I am talking about the T3 Menu which is shown on larger screens - not the off-canvas.

@uncleron12345
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok on Android it works even in Firefox. Maybe a convertible notebook is something special ;-) Thank you again.

@mac10046
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanx it worked ... but I have anchor links on the page - One Page Website, kind of - which are scrolling down to content and are again scrolling up automatically. What to do for it.

Please sign in to comment.