Closed koldsnapz closed 9 years ago
@koldsnapz, can you link to a jsfiddle or codepen so I can see your code and debug?
https://jsfiddle.net/fkjgdymj/
But as I build the code in the fiddle I noticed it started working (not properly setup yet so it looks ugly) but the issue may be a conflict of my Drupal environment...
Looks like it has to do with the version of jQuery used.. less than 1.7 causes it to break.
I have looked at this and made it completely compatible with jQuery 1.4.2+
need to switch the .on
calls to .delegate
and swap the selector and event like so:
Change:
$this.mobileNav.on('click', '.' + prefix + '_item', function (e) {
to:
$this.mobileNav.delegate('.'+prefix+'_item', 'click', function(e){
and
Change:
$this.mobileNav.on('keydown', '.'+prefix+'_item', function(e) {
to:
$this.mobileNav.delegate('.'+prefix+'_item', 'keydown', function(e) {
Be advised, I'm using the version that ships with Drupals adminimal_admin_menu module.
Also needed to change
$this.mobileNav.on('keydown', '[role="menuitem"]', function(e) {
to
$this.mobileNav.delegate('[role="menuitem"]', 'keydown', function(e) {
I can only open the initial menu from the Label. After that, none of the parent links open anything. This is not the case for the demo files. I tried changing the .js source to the one located in the /dist folder which is what the demo uses, but it still breaks.