DHTML Menu seems to work fine when accessing a page directly in the front-end or back-end themes, but if the D7 core Overlay module is enabled and an admin screen is opened in the overlay lightbox, the following JS error is reported:

TypeError: Result of expression '$('.menu li').css('margin-left')' [undefined] is not an object.

This causes JS functionality to break in the admin screens, making collapsible fieldsets inoperable among others.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scott.whittaker’s picture

Just to give more information, the error occurs at line 179 of dhtml_menu.js:

 // When using LTR, all icons can be shifted as one, as the text width is not relevant.
    if (settings.nav == 'bullet' && !rtl) {
      // Shift overlay to the left by the width of the icon and the distance between icon and text.
      var shift = '-' + (Math.ceil(($('.menu li').css('margin-left').replace('px', ''))) + 16) + 'px';
      ...
baldwinlouie’s picture

I am seeing the same behavior in D7

baldwinlouie’s picture

Status: Active » Needs review
FileSize
1.04 KB

I am not sure this fixes the underlying problem. But this patch does a hasClass() check on the "margin-left" attribute. Once applied, it fixes my overlay problems.

marcoka’s picture

# thanks, its seems also to fix these problems
http://drupal.org/node/1158784

drasgardian’s picture

thanks, #3 fixed it for me too

michaelfavia’s picture

This issue is causing a number of issues in downstream modules because it stops execution of JS (wysiwyg, media, etc).

Applied the patch to master branch and it fixes the issue. Not sure if the module should be loaded in this context or what the "actual" problem is but this helps alot of other project with erroneous reports. Please consider committing or telling us what should be happening and ill happily roll another patch.

I noticed the last commit on this module was 27 weeks ago. if you have other priorities and would like some help committing trivial stuff like this id be willing to comaintain for smaller issues like this.

Thanks. -mf

scor’s picture

Status: Needs review » Reviewed & tested by the community

Marked #1312692: Certain settings break color module and admin collapsing fields and #1158784: Js Problems as duplicate. The patch in #1 solves the issue for me as well. Given the amount of people who successfully tested this patch, I'm going to RTBC this.

KoCo’s picture

did work for me.

michaelfavia’s picture

Status: Reviewed & tested by the community » Fixed
Summit’s picture

Yep, latest version showed the submenu's in Bartik again! Thanks!
EDIT: But wit option: Expand on Bullet: All links will continue to function as static links. To expand an item, click the bullet icon next to the link.
Is not working anymore...

Thanks for going into this more.
Greetings, Martijn

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dspcore’s picture

Issue summary: View changes

to #3.
how to use this patch?
where should I add this?
Thanks for help.

DrupalHelpsMePowerNap’s picture

Without too much testing, #3 solved my issues with running DHTML Menu + Overlay.

mxr576’s picture

#3 did not work, but the following patch solved my problem.

vuil’s picture

Status: Closed (fixed) » Needs review
vuil’s picture

FileSize
913 bytes

Reroll the patch of #14.

  • ilchovuchkov committed d575d69 on 7.x-1.x
    Issue #1130250 by baldwinlouie, ilchovuchkov, mxr576, scott.whittaker,...
vuil’s picture

Status: Needs review » Fixed

Committed to the latest 7.x-1.x-dev branch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

vuil’s picture