Needs review
Project:
DQX AdminMenu
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
28 Jul 2012 at 21:09 UTC
Updated:
30 Jul 2012 at 17:05 UTC
Jump to comment: Most recent file
Not quite sure what is happening but it looks like event.stopPropagation() applied to the TR rows is breaking core tabledrag functionality (and also any other js which has events applied in a TR element).
Removing it fixes the issue and the menu still seems to work just fine.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | mouseengine_cleanup-1704338-7.patch | 2.67 KB | muhleder |
| #1 | event_stopPropagation.1704338.2.patch | 540 bytes | muhleder |
Comments
Comment #1
muhleder commentedComment #2
donquixote commentedThanks for helping out on these things!
I did not find the time to take sufficient care of this module in D7.
Patches are always welcome.
Comment #3
donquixote commentedI committed all your other patches to 7.x-1.x, but this one is in a separate branch now.
(7.x-1.x-dontStopPropagation)
I still need to do a bit of testing.
The js mouseover stuff is probably the most tricky part of the module. It underwent a lot of changes until I was happy with the performance etc. So I am not 100% sure which consequences this patch will have.
Also, there was an issue in Chromium on Linux, which is described here,
#1664920: Clicking a select element in the page opens the first dropdown submenu (Issue in Chrome/Chromium)
https://code.google.com/p/chromium/issues/detail?id=135109
(Probably totally unrelated, so I guess it won't be killed with this patch..)
Comment #4
muhleder commentedYup, I didn't really dig deep enough into that code to see what it was doing but it definitely breaks tabledrag functionality. The core menu item admin screens are broken for example at admin/structure/menu/manage/my-menu-name
One thing I did spot though was that the arguments provided didn't seem to match the arguments expected in mouseMove() for the simple and superfish engines.
dqx_adminmenu.js#531 and dqx_adminmenu.js#542
dqx_adminmenu.js#232 MouseEngine_simple
dqx_adminmenu.js#271 MouseEngine_superfish
Comment #5
donquixote commentedI checked, and the event.stopPropagation() indeed needs to be removed.
The event is only attached to $('body').mouseMove(), so we don't need to worry about redundant calls on nested elements.
I introduced this technique for performance reasons, and to not have tons of event handlers in memory.
The d.MouseEngine_superfish and d.MouseEngine_simple are there for historic reasons. The idea was some kind of pluggability for the mouse engine, if only for debugging. In normal operation, the mouse engine is immediately replaced by d.MouseEngine_directional.
However, at some point I did change the "API", and since then the other "mouse engines" are only there fir decoration..
Any idea to clean this up?
For now I just put a comment in there with "TODO".
Comment #6
donquixote commented7.x-1.0-unstable3 has
- all the fixes you suggested
- a few more inline submenus, and some menu items renamed. E.g. "Appearance > List" is now "Appearance > List available themes"
Some feedback would be welcome, but better in a new issue :)
Comment #7
muhleder commentedThe menu seems to work just fine if we take out the _simple and _superfish functions entirely, taking out those ~ 80 lines of code isn't going to make what's left more readable as well.
It's pretty simple change obviously but here's a patch anyway.
What might be good generally is a dqx_adminmenu.api.php file documenting the hooks.
http://stackoverflow.com/questions/4999138/drupal-are-hook-functions-in-...
Everyone here really likes the menu and we've been using it on our D7 site for a couple of months now, but it was pretty hard initially to work out how to use the hooks (for me at least).
Comment #8
donquixote commentedGood idea with the documentation file.
Btw, would you be interested in co-maintaining? I have the feeling, I won't be able to give this module as much time as it deserves. The D7 version has been sitting in this rough-edge state for too long.
Comment #9
muhleder commentedHi there, yeah I could help co-maintain this. Won't have a bunch of time, but I do have a long term client that uses it so if we find any issues I can certainly fix them. It's actually been pretty good apart from these few issues we've gathered over the past couple of days. It's had a good couple of months testing by us.
Comment #10
donquixote commentedNow have a look at the 7.x-2.x. A fishy surprise is waiting!