I have been using DHTML Menu for a while without any issues, and recently I installed IMCE. I found that the IMCE File Browser is not working (no icons and no preview of image etc.) unless I disable DHTML Menu.

So, I wondered if the IMCE File Browser Navigation is being considered as if it is a Drupal menu, and DHTML Menu is trying to DHTML enable it.

I have configured DHTML Menu to enable only for Administrator menu and Navigation menu - this doesn't fix the issue.

I am using Firefox so I used Firebug and found the code where the error occurs.

In Firebug console I get:

$(".menu li").css("margin-left") is undefined

Then, it shows the line of code where the problem occurs. It is line 508 in the code segment shown below:

505 // When using LTR, all icons can be shifted as one, as the text width is not relevant.
506 if (settings.nav == 'bullet' && !rtl) {
507 // Shift overlay to the left by the width of the icon and the distance between icon and text.
508 var shift = '-' + (Math.ceil(($('.menu li').css('margin-left').replace('px', ''))) + 16) + 'px';
509 // Shift the overlay using a negative left-hand offset, and the text using a negative right-hand margin.
510 $('.dhtml-menu-icon').css('left', shift).css('margin-right', shift);
511 }

So, does this mean there is something wrong with CSS or is this a bug in DHTLM Menu ? I am trying to understand why DHTML Menu would be attempting to process the menu, which is actually part of IMCE File Browser. It also looks like this problem only occurs if I use 'bullet' mode in DHTML Menu settings.

CommentFileSizeAuthor
#2 dhtml_menu-menu_check-1084152-1.patch499 bytesAngry Dan

Comments

TimAlsop’s picture

Category: support » bug

I reported this issue on IMCE issue queue, and somebody confirmed it is a bug in DHTML Menu. They even tested a fix by modifying the DHTML Menu code. Please see http://drupal.org/node/1093772.

The suggested fix is:

Replace $('.menu li').css('margin-left') with ($('.menu li').css('margin-left') || '0') 

Can somebody confirm if the fix suggested is correct, or is there a better fix ?

Angry Dan’s picture

StatusFileSize
new499 bytes

This is not IMCE specific - it's because you don't have any standard Drupal menus on the page.

I've written a patch that should solve the issue by not running any of the behaviour if there are no menus on the page.

BTW I'm using Drupal 7, where this issue also applies.

Jorge Navarro’s picture

Having the same problem with module filter. Patch #2 works like a charm! thank's

Jorge Navarro’s picture

Version: 6.x-4.x-dev » 7.x-1.0-beta1