While editing a view via the Views UI, the DHTML module's menu effects become disabled. Functionality returns once the Views editing page is exited. This was actually present in beta2, as well (but I don't think it was present before that).

Comments

merlinofchaos’s picture

Project: Views (for Drupal 7) » DHTML Menu
Version: 6.x-2.0-beta3 » 6.x-2.0
Component: Miscellaneous » Javascript code

Hmm, that's neat.

FYI this only happens after an AJAX request has been made by Views. My guess is that DHTML Menu has a problem with its behaviors code that causes it to fail when Views' behaviors are rerun.

cburschka’s picture

Is there any error console output? I'll test it shortly.

cburschka’s picture

Title: Views UI Disables DHTML Menu Effects » Views UI causes duplicate DHTML Menu switch

The behavior I have observed with the latest versions of Drupal 6, DHTML Menu and Views is that the menu is switched twice. It opens and closes, or closes and opens.

This indicates that the switchMenu() function is called twice. I shall investigate.

cburschka’s picture

Assigned: Unassigned » cburschka
Priority: Minor » Normal

Diagnosis: The response to the Views AJAX request causes Drupal.behaviors.dhtmlMenu() to be called again, adding listeners twice.

I have to take this to irc; Drupal's JS behaviors are beyond me.

Views is an essential module, though, so this bug isn't minor.

cburschka’s picture

Title: Views UI causes duplicate DHTML Menu switch » Views UI AJAX response causes duplicate Drupal.behaviors.dhtmlMenu call

Updated.

cburschka’s picture

Nobody's answering in IRC, but merlin's post hints that the behaviors are supposed to be re-run. This means I will set a flag to ensure the function cancels when it is called again.

cburschka’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new673 bytes

I'm declaring a script-scope variable named dhtmlRun and checking it in the behaviors function. If it's true, the function returns, otherwise it is set to true.

This fixes the problem; AJAX requests in Views now no longer break DHTML Menu.

cburschka’s picture

Status: Needs review » Fixed

Committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

colinjones’s picture

Status: Closed (fixed) » Active

This exact same behaviour appears when Ajax editablefields are exposed whilst viewing a node (nothing to do with Views). The DHTML menus open/close or close/open... also the top submenu entry in the menu you are trying to expand starts getting duplicated - I have ended up with 4 copies of the parent menu's home page submenu entry. When I turn off the option that creates a submenu entry for the parent menu entry's page, it simply duplicates the next submenu entry along...

colinjones’s picture

Just noticed that the submenu entry representing the parent menu (enabled by an option in DHTML Menu) duplicates even when you sort a Views view using AJAX clickable column headings. As soon as you turn off AJAX the behaviour goes away.

marcoka’s picture

for you information, this patch woks, but it is not jet in the d7 branch. so in the d7 version you will have exactly that problem.

marcoka’s picture

vuil’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

I closed the issue as Closed (outdated) because it is for unsupported 6.x version of Drupal.